2023-03-19
- Fix the error message for lone quantifier brackets
2023-03-19
- [breaking] Actually reject lone quantifier brackets in input
2023-03-19
- Avoid creating quantifiers by accident. Now
sequence(/a{/, /1}/)
returns/a{(?:)1}/
. Fixes #10
2023-02-08
- Add a package.json file to the commonjs folder such that
require("compose-regexp")
works.
2023-01-30
- Docs: correct typo in the README (#9 @Kawacrepe)
2023-01-27
- ES6 conversion, bump babel, switch to terser. The .min.br file is 92 bytes lighter as a result.
2023-01-14
- More logo tweaks
2023-01-13
- Merge README fixes (version bump for the npm README).
2023-01-13
- Cosmetic tweaks to the logo (version bump for the npm README).
2022-05-21
- Bump
ref()
indices when directly nested in acapture()
call.
2022-05-19
- Better character class detection, resulting in fewer non-capturing groups being inserted when adding quantifiers.
2022-05-08
- Better handling of empty parameter lists.
2022-05-08
- Actually fix the last bug...
2022-05-08
Address various lgtm.com concerns
- Remove a ReDOS vuln in the quantifier validator.
atomic()
FTW, but where's my credibility now?
2022-05-08
- Docs tweaks
2022-05-07
- Fix the
flags.add
typings
2022-05-07
- Correctly handle variadic params in TS
2022-05-07
- Better TypeScript typings
2022-05-06
- Added TypeScript typings
2022-05-05
- Fix the postinstall script and other NPM-related shenanigans
2022-05-05
Another dummy release to test the npm postpublish script
2022-05-04
- Tweak the back reference thunk format
2022-05-04
Dummy release to test the npm publish script
2022-05-04
- More efficient and terser set intersection
2022-05-02
- Publish AMD and artefacts
2022-05-02
- Ignore look behind assertions when counting captures
2022-04-25
- Fix another bug when upgrading non-u regexps to u
2022-04-24
- Better logic to upgrade non-u regexp to unicode
2022-04-22
noBound(x)
matches wherebound(x)
doesn't and vice-versa. Think/\B/
vs/\b/
.charSet.invert(x)
will succeed wherex
doesn't and vice-versa. think/[^a-z]/
vs/[a-z]/
- Fix a typo in the mixed m-flag detection code for legacy environments
- added Compatibility and Contribution sections in the README
2022-04-22
Doc tweaks for the npm README
2022-04-22
This version revamps the core to provide better support for the u
flag. The ref()
story is also far more robust. ref()
lets us introduce an atomic()
helper that prevents the engine from backtracking.
avoid()
becomesnotAhead()
(mirroring the newly introducedlookBehind()
,notBehind()
scheme).- back references (e.g.
\1
) are now updated when regexps that hold them are combined.sequence(/(.)\1/, /(.)\1/)
returns/(.)\1(.)\2/
ref()
now returns a thunk, to let one create back references programmatically.sequence(/(.)/, ref(1))
returns/(.)\1/
- The
u
flag is now contagious, non-unicode RegExps are promoted to unicode when possible. - RegExp with an
m
ors
flag are converted into flagless equivalent that match the same input (e.g././s
=>/[^]/
) - We're now stricter WRT input. Pass in a bad argument, and you'll
meet the wrath of our ...get a nice error message. - Beside
u
promotion andm
ands
folding, the combinators don't accept mixed flags as input.
atomic(...exprs)
will create an atomic group that prevents backtracking into the expression once it has matched. ReDOS, begone!atomic()
is direction sensitive, see below).bound(pattern)
generalizes the/\b\
assertion to arbitrary character classes (or patterns, really)charSet.*()
methods let one do set arithmetics on character sets.- The combinators also accept as parameters, string, regexps, or arrays of parameters and functions that return parameters. An Arrays is treated like
sequence()
. Functions come in handy for look behind assertions. ref("label")
creates a named reference (/\k<label>/
).namedCapture("label", ...)
returns (/(?<label>...)/
)- support
lookBehind()
andnotBehind()
assertions. - pattern directionality. Patterns that contain numeric back-references have an assorted direction depending on the context where they are evaluated, and they can't be mixed. The default is forward, so
lookBehind(ref(1), capture(/\w/))
will be rejected.lookBehind(()=>[ref(1), capture(/\w/)])
however will do what you want, because the function is then evaluated in backward context.
- fix the exports paths in
package.json
... to @Hypercubed who submitted a PR for an issue that was solved independently.
- fix broken package.json
- added an auto-curried version of
flags()
. - ported the full test suite to ospec
Here be drgns...