\W means Match non-word character. As almut said its not required for replace what you are trying to do. Just s/$query/<em>$query</em>/i would be fine. Perl regex
In reply to Re: How to use \W in Regular Expression?
by gube
in thread How to use \W in Regular Expression?
by Sachin
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |