Debugging regexes is mind torture. Peep the test cases.