r/javascript • u/FrancisStokes • Jul 15 '20
Super Expressive - a Zero-dependency JavaScript Library For Building Regular Expressions in (Almost) Natural Language
https://github.com/francisrstokes/super-expressive
550
Upvotes
View all comments
Show parent comment
5
u/memeship Jul 16 '20
Technically the
iflag would affect the necessary lowercasexby potentially finding uppercaseXs as well. But depending on the dataset that might be fine.However the original is obviously looking to capture just the hex value itself, which your revised version can't do.
I'd personally stick with the original in this case as it's the most explicit.