super-expressive icon indicating copy to clipboard operation
super-expressive copied to clipboard

Compare with similar libraries

Open francisrstokes opened this issue 4 years ago • 0 comments

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')

francisrstokes avatar Aug 11 '20 07:08 francisrstokes