If you're sure that your shell doesn't expand metacharacters (that is, print $regexReplace to make sure it's sane), add the /e flag to your regexp.
In reply to Re: s/// treat rhs as regex
by chromatic
in thread s/// treat rhs as regex
by chuckH
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |