2 ms·
The regular formalism is very neat and I like to use it, but the RegExp syntax doesn't do it justice. They are pretty much write-only, and there's no way to co
by pygy_ 8y ago
The regular formalism is very neat and I like to use it, but the RegExp syntax doesn't do it justice.
They are pretty much write-only, and there's no way to compose two regexps safely (new `RegExp(a.source, b.source)` breaks for `/a|A/, /b/, for example).
Rex is a good attempt at solving this. I wrote a similar lib a while ago (more functional and tighter in design, see my other comment on this page).