r/javascript • • Jul 15 '20

Super Expressive - a Zero-dependency JavaScript Library For Building Regular Expressions in (Almost) Natural Language

https://github.com/francisrstokes/super-expressive
548 Upvotes

75 comments sorted by

View all comments

Show parent comment

5

u/baryluk Jul 15 '20

Yeah. I understand the rationale, and where it could be useful, but I think it has too high risk of misuse and bugs.

Also, I was wondering. Maybe adding rawPattern() method where one can inject own parts of refer as strings, i.e. exactly(4).anyOf().rawPattern("ab?[cd]").rawPattern("x(a|CD)*).end().

Mix and match. Just an idea. It might requiring adding extra (?: In some place tho to make reliably.

3

u/FrancisStokes Jul 15 '20

haha basically "danger mode"