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

RegExp should handle surrogate pairs correctly. #6592

Closed
ErikCorryGoogle opened this issue Nov 7, 2012 · 8 comments
Closed

RegExp should handle surrogate pairs correctly. #6592

ErikCorryGoogle opened this issue Nov 7, 2012 · 8 comments
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-l P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug

Comments

@ErikCorryGoogle
Copy link
Contributor

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).

@madsager
Copy link
Contributor

madsager commented Nov 7, 2012

cc @floitschG.
cc @iposva-google.
cc @lexprfuncall.
Added Area-Library, Triaged labels.

@lexprfuncall
Copy link

Are these requirements any different from the behavior specified by the new u flag in ES6?

@ErikCorryGoogle
Copy link
Contributor Author

Not that I know of.

@lrhn
Copy link
Member

lrhn commented Oct 15, 2013

Removed Type-Defect label.
Added Type-Enhancement label.

@ErikCorryGoogle ErikCorryGoogle added Type-Enhancement area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. labels Oct 15, 2013
@kevmoo kevmoo added P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug and removed triaged labels Feb 29, 2016
@lrhn lrhn added the core-m label Aug 11, 2017
@floitschG floitschG added core-l and removed core-m labels Aug 29, 2017
@f3ath
Copy link

f3ath commented Apr 26, 2023

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?

@lrhn
Copy link
Member

lrhn commented Apr 26, 2023

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 unicode flag.
I'll open a separate issue for the bug.

@lrhn lrhn closed this as completed Apr 26, 2023
@f3ath
Copy link

f3ath commented Apr 26, 2023

@lrhn could you please tag me in the new issue?

@f3ath
Copy link

f3ath commented Apr 26, 2023

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. core-l P2 A bug or feature request we're likely to work on type-enhancement A request for a change that isn't a bug
Projects
None yet
Development

No branches or pull requests

7 participants