Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No support for \p{unicode char class} that is supported by the Go stdlib regex package #65

Closed
kovidgoyal opened this issue May 12, 2023 · 2 comments

Comments

@kovidgoyal
Copy link

kovidgoyal commented May 12, 2023

Extract from https://pkg.go.dev/regexp/syntax

\pN            Unicode character class (one-letter name)
\p{Greek}      Unicode character class
\PN            negated Unicode character class (one-letter name)
\P{Greek}      negated Unicode character class

I imagine this could be implemented in RE2 compat mode.

kovidgoyal added a commit to kovidgoyal/kitty that referenced this issue May 12, 2023
Note that we loose unicode char matching for --type=word because of
dlclark/regexp2#65 and of course user regexps
cant use \p{N} escapes any more. Hopefully regexp2 will add support for
these soon-ish. IMO lookaround is more important than \p.

Fixes #6265
@dlclark
Copy link
Owner

dlclark commented May 13, 2023

The \p{N} syntax is already supported, but I'll need to add \pN support. Since the current behavior for this syntax is a compile error I'm considering adding it as default behavior and not putting it behind the RE2 flag. It's hard to imagine that anybody is depending on the existing compile error if they used the \pN syntax and this makes regexp2 line up with PCRE, Rust, and Go.

@kovidgoyal
Copy link
Author

Sounds good to me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants