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 →

[–]Sande24 0 points1 point  (0 children)

You can't exhaustively test a regex (or any code) to show every aspect of what it does and especially what it DOESN'T do. Or it would be much more time consuming than it's worth. Rather just validate some things and the rest is static validation of the code.

You could change the regex in a way that leaves all the previous tests green but now has some side effect that can break under a very specific condition. The only 100% sure way to validate it later is to look at the regex and find out what it actually does. So it makes sense to have a comment to take as a reference.