in reply to Re: Determing if this regex matched
in thread Determing if this regex matched
But that doesn't seem very elegant.my @items = ('"Title Text Example"', 'Title Text Example', ' Title Tex +t Example ',' "Title Text Example"'); foreach my $title (@items) { my $changed = 0; if ($title =~ s/^[\s"]+//) { $changed=1; } if ($title =~ s/[\s"]+$//) { $changed=1; } if ($changed) { print "$title\n"; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Determing if this regex matched
by ww (Archbishop) on Aug 06, 2011 at 20:06 UTC | |
by cormanaz (Deacon) on Aug 06, 2011 at 20:34 UTC | |
by AnomalousMonk (Archbishop) on Aug 07, 2011 at 10:22 UTC | |
|
Re^3: Determing if this regex matched
by merlyn (Sage) on Aug 06, 2011 at 20:12 UTC | |
by cormanaz (Deacon) on Aug 06, 2011 at 20:30 UTC |