Sachin has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -W $str = "i am perl: a system"; $query = "perl"; $str =~ s/$query\W+/<em>$query<\/em> \W+/ig; print " Value = " . $str;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to use \W in Regular Expression?
by almut (Canon) on Dec 30, 2009 at 12:08 UTC | |
by Sachin (Acolyte) on Dec 30, 2009 at 12:14 UTC | |
by almut (Canon) on Dec 30, 2009 at 12:17 UTC | |
by Sachin (Acolyte) on Dec 30, 2009 at 12:31 UTC | |
by ikegami (Patriarch) on Dec 30, 2009 at 12:37 UTC | |
by almut (Canon) on Dec 30, 2009 at 12:36 UTC | |
by AnomalousMonk (Archbishop) on Dec 30, 2009 at 13:10 UTC | |
| |
|
Re: How to use \W in Regular Expression?
by ikegami (Patriarch) on Dec 30, 2009 at 14:29 UTC | |
|
Re: How to use \W in Regular Expression?
by gube (Parson) on Dec 30, 2009 at 15:25 UTC |