DEV Community

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

Collapse
 
craser profile image
Chris Raser

I usually add a comment with two key things: a sample of the input it's supposed to parse, and a list of what's getting pulled out as a capture group.

But even then, I use them with reluctance, and only with rigorous unit tests to make sure they do exactly what I want.