in reply to Re: Regular Expression To Extract Multiple Matches Pattern
in thread Regular Expression To Extract Multiple Matches Pattern
while ($teststring =~ /\b(\w+-\w+-\w+)\b/gi) { print "$1\n"; }
Also too, the boundary markers \b as suggested in the reply by Kanji have merit and I think warrant inclusion.
Update
As busunsl rightly points out, \w includes the underscore character in matching which has not been specified for inclusion ... [\w[^_]] anyone? :-)
perl -e 's&&rob@cowsnet.com.au&&&split/[@.]/&&s&.com.&_&&&print'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Regular Expression To Extract Multiple Matches Pattern
by busunsl (Vicar) on Jan 07, 2002 at 16:20 UTC | |
|
Re: Re: Re: Regular Expression To Extract Multiple Matches Pattern
by blakem (Monsignor) on Jan 08, 2002 at 00:23 UTC |