I've personally never felt comfortable using regexes to solve production problems. The certificate code referenced here shows why:
https://github.com/mozilla-firefox/firefox/blob/d5979c2a5c2e...
Yikes.
replies(3):
https://github.com/mozilla-firefox/firefox/blob/d5979c2a5c2e...
Yikes.