SeekerOKnowledge has asked for the wisdom of the Perl Monks concerning the following question:
Thanks again for any comments passed on.#!/usr/bin/perl my $s = "blah,blah,blah <PgfTag `Normal \(T\)'> yadda,yadda,yadda"; print "s =\t\"$s\"\n"; #my $pattern = qr{\s*<PgfTag `Normal \(T\)'>\s*}; my $pattern = qr{ \s* <PgfTag `Normal \(T\)'> \s* }; my $k = 0; $s =~ s/$pattern/++$k && ','/gex; print "$k change(s)\n"; print "s =\t\"$s\"\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: commenting regular expressions (take two)?
by Zeroth (Beadle) on Sep 04, 2003 at 18:32 UTC | |
|
Re: commenting regular expressions (take two)?
by tcf22 (Priest) on Sep 04, 2003 at 18:32 UTC | |
by SeekerOKnowledge (Initiate) on Sep 04, 2003 at 19:50 UTC |