Make these regexes stricter by disallowing any additional characters in the output.
Thanks to dblaikie for pointing this out!