I need to escape characters like ^, ., [, ], + and \ (tabs and newlines won’t be an issue), while leaving others like * and ?.
EDIT = More specifically, I have a string with these characters, and I need to escape them so that they are not matched by regular expressions. I need to prepend \ to each of these characters, but doing so individually would take 7 or 8 scans and I’d like to do it within just one pass (IE: anything that matches is prepended with \)
How do I do this?
Thanks.
Would this work?