DEV Community

Discussion on: What are your code smells and/or best practices with regular expressions?

Collapse
 
moopet profile image
Ben Sinclair

Use them all the time outside of "programming", like in shell commands or quick one-off hacks. Only use them in code when they're run against predictable input.
That's it. Just validate that they match something before assuming that they're right, and if your predictable input fails to match, log the context.