|
|
| Pathologically Eclectic Rubbish Lister | |
| PerlMonks |
Re: Print only if pattern matchesby Athanasius (Vicar) |
| on Jan 24, 2013 at 07:00 UTC ( #1015089=note: print w/ replies, xml ) | Need Help?? |
|
The script can be re-written so:
While this “works”, it is dubious: the * quantifier in a regex means match zero or more of the preceeding; in the substitution, do you really want to match zero occurrences of (.*\|) or ([\d.]+|[\w.]+)? If not, use the + quantifier meaning one or more. Hope that helps,
In Section
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||