RegExp.escape function for quoting text for a regular expression.