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
RegExp should handle surrogate pairs correctly. #6592
Comments
cc @floitschG. |
Are these requirements any different from the behavior specified by the new u flag in ES6? |
Not that I know of. |
Removed Type-Defect label. |
Wondering if this will be prioritized. The following code behaves differently on CLI and in Web: void main() {
print(RegExp(r'a[^x]b', unicode: true).hasMatch('a\uD800\uDD01b')); // true in Web, false in CLI
} Any suggestions on a workaround for this issue? |
The unicode flag is the solution to this issue, which should be considered solved now. The code you show here suggests that there is a bug in the implementation of the |
@lrhn could you please tag me in the new issue? |
Thank you! |
The . operator should match a surrogate pair.
A character class should be able to match a surrogate pair.
Ranges in character classes should be surrogate pair aware.
Grouping should be surrogate pair aware, so that x+ matches 1 or more pairs (if x is a pair).
The text was updated successfully, but these errors were encountered: