Parser: improve regular expressions

Also fixes #144