Any secret escape sequence code that only escape forward slashes?s{/}{\\/}g
Don't try to do it all at once. Write a simple function that escape forward slashes, and call that in the replacement part of your substitution. You can use s{}{}ge to evaluated the replacement part, and comfortably call functions there.
In reply to Re: regex escaping forward slash in regex
by moritz
in thread regex escaping forward slash in regex
by gilemon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |