super-expressive
super-expressive copied to clipboard
Compare with similar libraries
VerbalExpressions
is a library that's been around for a long time, with a lot of stars and a lot of ports, but there are reasons to choose SuperExpressive
instead:
-
VerbalExpressions
are incompatible with Promises and Async/Await, because they contain a non-compliant.then()
method. If you return a verbal expression from a promise, it's not going to behave as expected. - No support for various regular expression features:
- non-capturing groups
- named groups
- backreferences
- lookaheads
- etc
- No support for sub expressions, so creating reusable parts is not possible
-
VerbalExpressions
are mutable, so creating a new expression based on an existing one is not possible (see example below)
expr.maybe('s');
const expr2 = expr.maybe('t');
// expr is now: expr.maybe('s').maybe('t')