-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Description
So, it appears that JavaScript now does support positive lookbehinds (e.g. "(?<=foo)"
), Unicode property escapes (i.e. "\\p{Greek}"
), and named capture groups (e.g. "(?<foo>.*)"
), at least according to the next release of the ECMA-262 specification. They are already supported in Chrome 64 and later.
https://github.com/tc39/proposal-regexp-named-groups
https://github.com/tc39/proposal-regexp-lookbehind
https://github.com/tc39/proposal-regexp-unicode-property-escapes
Unfortunately, the Dart VM/AOT compiler version of RegExp (i.e. when not compiled to JS) doesn't seem to support them, so the statement "Dart regular expressions have the same syntax and semantics as JavaScript regular expressions" isn't really true anymore. Some regular expressions work on Dartpad, but not in Flutter, for instance.
Dart should implement these too: they're also super useful.