-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Unicode Properties are not supported/broken for Regular Expressions (Regex) #29807
Comments
Hya, is there anything new with this issue? for now, I just use English characters which is not very good for my project in the long run |
I had the same issue recently. |
Any clues on what can cause this? On multiple environment it only occurs on one and we yet to figure out the reason. |
it doesn't do anything for me, is there an extra step to do ? [EDIT] I forgot to update my babel config in module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: ['@babel/plugin-proposal-unicode-property-regex'],
}; |
Can somebody confirm that it works properly on not properly 🙂 |
Hey, @cortinico @conradlo @odyodyodys @safaiyeh @Bardiamist
I used this xregexp library to support Unicode Properties functionality. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days. |
This issue was closed because it has been stalled for 7 days with no activity. |
I can confirm that "Unicode Properties are not supported/broken for Regular Expressions (Regex)" are not supported when Hermes is enabled |
🎬 I am getting back with an update. I tried to use xregexp and it started working, but I debugged it and didn't see anything why I needed to use this library.
✅ I successfully built the project and error with "Invalid dialect ..." disappeared, that's it) |
Description
The
Unicode Properties
feature for regular expression is supported for Node, Swift and Java (see References bellow).However, when I use that feature in my code, it returns a wrong answer (specifically I used
\p{L}
and thetest
method).For example,
/\p{L}/u.test('a')
returnsfalse
.References
JS - https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions/Unicode_Property_Escapes
Swift - https://developer.apple.com/documentation/foundation/nsregularexpression
Java - https://docs.oracle.com/javase/tutorial/essential/regex/unicode.html
React Native version:
Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.
anywhere in your app component.
Expected Results
/\p{L}/u.test('a')
and/\p{L}/u.test('ש')
should returntrue
(they have the unicode property "Letter").they both return
false
.Snack, code example, screenshot, or link to a repository:
The text was updated successfully, but these errors were encountered: