DEV Community


Discussion on: A Visual Guide to Regular Expression

eecolor profile image

Good write! When I explain regular expressions I tend to mention the following points:

  • Once you learn regular expressions, please remember that you barely ever need them. Things tend to look like regex nails ;-)
  • If your regular expression starts to look back at you in an intimidating fashion, you are probably better off using something else.
  • You should not use a regular expression for things that involve nesting (code, html, ...)

I also point people towards RegExr, especially the 'Tests' tab is amazing, make sure you also write tests for the things you do not want to match.

dougaws profile image

The greatest danger using regular expressions is a global search and replace. I can't tell you how many times I've seen inadvertent changes cause down stream problems.

amitness profile image
Amit Chaudhary Author

Great to know. I'll update the post with a link to Regexer.