properly escape regular expression