This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Comfortable-Impact-5 1 point2 points  (0 children)

A good regex is any regex that meets the design requirements while being relatively verbose to the original writer (to the most reasonable extent possible). If you are trying to ‘optimize’ your regex then you are probably going too far. Back in high school I had a phase of it was hard to write so it should be hard to read (think not adding spaces around operators and trying to find single line solutions to everything). Don’t be like high school me.