v1.0.0
Most of the changes and fixes in this release resulted from feedback by @RedCMD. ✨
Note that every fix and newly-supported syntax in this release addresses an extreme edge case that did not affect even one regex in the tens of thousands of Oniguruma regexes found in the TextMate grammars provided by Shiki.
🚨 Breaking
- Redesigned the recursion depth limit around the fact that Oniguruma uses a limit of
20
(rather than an infinite or high-value depth like other regex flavors). (#19)- Moved option
maxRecursionDepth
torules.recursionLimit
. - Changed the default
recursionLimit
from5
to20
. - Reduced the max
recursionLimit
from100
to20
. - Removed the ability to disable support for recursion.
- Setting
accuracy
to'strict'
no longer disables recursion.
- Moved option
🚀 Features
- Support
\x{…}
values above10FFFF
at the end of character class ranges. (#22) - Validate lookbehind contents and throw if not supported by Oniguruma. (#24)
- Support possessive interval quantifiers specified using a reversed range. (#25)
- Error at compile time rather than runtime for Unicode property names that start with a digit.
- Improved test coverage.
🐞 Fixes
- Don't remove negation for negated character classes used in intersection that contain a single token (bug applied when using
target
ES2024
or later and optionverbose
not enabled). - Ignore insignificant hyphens in Unicode property names. (#16)
- Don't throw for intersection with an empty set. (#17)
- Don't throw for character class ranges ending with literal hyphens followed by character or character-set tokens. (#18)