Filter Variable to Escape Regular Expression Special Characters

Dan, always to the rescue! I searched the forum and this was exactly what I was looking for. It worked for me, but with the replace string as 2 slashes instead of 3:

\\$1

It was also cool to learn from this that when wrapped in [square brackets], only a handful of these special characters need to be escaped with the preceding \ rather than needing to do them all: \. \* \+ \? etc

Thanks for posting this!

2 Likes