fixes #2: escape metacharacters of regular expressions
#2: update test cases;