fix the regexp match function