#!/usr/bin/perl -W $str = "i am perl: a system"; $query = "perl"; $str =~ s/$query\W+/<em>$query<\/em> \W+/ig; print " Value = " . $str; [download]
In reply to How to use \W in Regular Expression? by Sachin