I suspect you’re opening a can of worms. Can you not just turn of Grep search?
See https://stackoverflow.com/questions/399078/what-special-characters-must-be-escaped-in-regular-expressions Escaping everything might be safe but hard to read — https://en.wikipedia.org/wiki/Perl_Compatible_Regular_Expressions: > Like Perl, PCRE has consistent escaping rules: any non-alpha-numeric > character may be escaped to mean its literal value by prefixing a backslash Cheers > On 2018-03-09, at 14:50, Rick Gordon <[email protected]> wrote: > > I see that I also need other searches to escape tabs and returns: > > FIND: > \t > > CHANGE TO: > \\t > > and > > FIND: > \r > > CHANGE TO: > \\r > > -------------------- > On March 8, 2018 at 5:48:15 PM [-0800], > Rick Gordon wrote in an email entitled > "Regex to Escape Regex Characters in Any String": >> I'm trying to formulate a grep string that will cause any potential regex >> metacharacters in the target to be escaped with a backslash. Does this look >> as though it covers it, or do you see omissions or unnecessary entries? >> >> FIND: >> ([\\^$()\[\]{}*?+.]) >> >> CHANGE TO: >> \\\1 > ___________________________________________ > RICK GORDON > EMERALD VALLEY GRAPHICS AND CONSULTING > ___________________________________________ > WWW: http://www.shelterpub.com -- This is the BBEdit Talk public discussion group. If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group. Follow @bbedit on Twitter: <http://www.twitter.com/bbedit> --- You received this message because you are subscribed to the Google Groups "BBEdit Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/bbedit.
