v5.0.0
Breaking Changes
- Enable the
namespacing
feature by default for alignment with ES2018 (moves named capture properties to thegroups
object of matches and to the last argument of replacement callbacks): #316 - Handle ES2018 capture names (mostly this adds support for an extended set of Unicode characters, but it also prevents using a number as the first character in a capture name): #247
- Remove support for Unicode blocks, for alignment with ES2018 (use Unicode scripts instead): #225
Improvements
- Support optional '
Script=
' prefix (from ES2018 syntax) for Unicode script tokens: #225 XRegExp.matchRecursive
: Add delimiter and position info to error when unbalanced delimiters are found: #293- Avoid inserting unneeded
(?:)
into native regex source in more cases: 076f950 and d78a262 - Defer to native flag
s
in ES2018 environments: 98abea8
Bug Fixes
XRegExp.exec
: Preserve thegroups
object that comes from native ES2018 named capture: c4a83e7XRegExp.exec
: Set thegroups
property toundefined
if there are no named captures: #320XRegExp.escape
: Escape whitespace in a way that works with ES6 flagu
: #197XRegExp.replace
: Throw when using native named capture and a numbered backreference one higher than the number of captures in the replacement text: #317XRegExp.replace
: Fix edge case issues with replacement text syntax: #318