fixed bugs in regular expressions