Remove unused code
Code cleanup
Cleaner test for invalid regular expressions