fix bugs in regex expression