Skip to content

v5.0.0

Compare
Choose a tag to compare
@josephfrazier josephfrazier released this 08 Feb 23:52
· 29 commits to master since this release
e52e0a0

Breaking Changes

  • Enable the namespacing feature by default for alignment with ES2018 (moves named capture properties to the groups 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 the groups object that comes from native ES2018 named capture: c4a83e7
  • XRegExp.exec: Set the groups property to undefined if there are no named captures: #320
  • XRegExp.escape: Escape whitespace in a way that works with ES6 flag u: #197
  • XRegExp.replace: Throw when using native named capture and a numbered backreference one higher than the number of captures in the replacement text: #317
  • XRegExp.replace: Fix edge case issues with replacement text syntax: #318