make regexes javascript friendly