regexpp icon indicating copy to clipboard operation
regexpp copied to clipboard

Fixed named backreferences in strict mode

Open RunDevelopment opened this issue 3 years ago • 0 comments

This fixes #23.

Changes:

  • countCapturingParens now counts the number of named and unnamed groups separately.
  • The _nFlag property is now set by consumePattern instead of validatePattern.
  • Patterns are now validated in a single pass (after the initial counting of all capturing groups).
  • Added two new test files to verify the fix. The regexes in these test files are the ones from test/fixtures/parser/literal/named-capturing-group-valid-2018.json. I simply copied the file and divided the patterns based on whether they are valid with strict: true.

RunDevelopment avatar Jun 03 '21 10:06 RunDevelopment