Conversation
|
|
Hi! XRegExp v5 has a breaking change described at https://github.com/slevithan/xregexp#named-capture-breaking-change-in-xregexp-5 Specifically, named backreference properties now appear on the result's groups object (following ES2018), rather than directly on the result. To restore the old handling so you don't need to update old code, run the following line after importing XRegExp: XRegExp 4.1.0 and later allow introducing the new behavior without upgrading to XRegExp 5 by running Following is the most commonly needed change to update code for the new behavior: // Change this
const name = XRegExp.exec(str, regexWithNamedCapture).name;
// To this
const name = XRegExp.exec(str, regexWithNamedCapture).groups.name;Let me know if you have any questions and I'll be happy to help! |
7264eb2 to
9b91ad0
Compare
8e96824 to
fc226b3
Compare
fc226b3 to
73300da
Compare
73300da to
1b346cb
Compare
1b346cb to
9185d92
Compare
9185d92 to
c5af810
Compare
c5af810 to
f572810
Compare
f572810 to
308762f
Compare
56806b3 to
f1cf702
Compare
f1cf702 to
f7d6602
Compare
f7d6602 to
a42c4eb
Compare
This PR contains the following updates:
^4.2.4→^5.0.0Release Notes
slevithan/xregexp (xregexp)
v5.1.2Compare Source
Bug Fixes
v5.1.1Compare Source
Improvements
/dflag in ES2021 environmentsBug Fixes
package.jsonv5.1.0Compare Source
Breaking Changes
XRegExp.matchRecursive: When doing a global, non-sticky search and providingvalueNames, return an empty array if no matches are found, rather than an array with one object containing abetweenvalue that contains the whole target string (this change is to match every other case when no matches are found, e.g. when not providingvalueNames, not using global with flagg, or doing a sticky search with flagy):6e1711eImprovements
XRegExp.matchRecursive: Add support for matching with unbalanced delimiters (newunbalancedoption with supported values'error'[default],'skip', and'skip-lazy'): #960f52a62v5.0.2Compare Source
XRegExp.matchChain: #325XRegExp.escapeto handle-,,, and#in a way that is compatible with ES6 flagu: #323v5.0.1Compare Source
docsfolder with extensive documentation.v5.0.0Compare Source
Breaking Changes
namespacingfeature by default for alignment with ES2018 (moves named capture properties to thegroupsobject of matches and to the last argument of replacement callbacks): #316Improvements
Script=' prefix (from ES2018 syntax) for Unicode script tokens: #225XRegExp.matchRecursive: Add delimiter and position info to error when unbalanced delimiters are found: #293(?:)into native regex source in more cases:076f950andd78a262sin ES2018 environments:98abea8Bug Fixes
XRegExp.exec: Preserve thegroupsobject that comes from native ES2018 named capture:c4a83e7XRegExp.exec: Set thegroupsproperty toundefinedif 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: #318v4.4.1Compare Source
v4.4.0Compare Source
v4.3.0Compare Source
Configuration
📅 Schedule: (UTC)
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.