Do you test your regular expressions?
Updated by Igor Goldobin 1 year ago. See history
123
Everyone writes unit tests for their code, because it helps developer to make changes in future without breaking existing functionalities. The same goes for regular expressions. A good regular expression will have a set of test cases to make sure any future changes does not invalidate existing requirements. You should not fix a regular expression until we have added a good and a bad test case.
If your application is driven by regular expressions, you need a good test harness. Here is an example of a test harness we use in CodeAuditor.

Figure: Test Harness for regular expressions in CodeAuditor