fixed bugs in regular expression