in reply to I don't remember regex seeming this hard before
You want a parser, not a regex. But I am in a weird mood ...
my $test = "<<a> a> a <a>"; for ($test) { my $count = 0; s{(.)}{ $count++ if $1 eq '<'; $count-- if $1 eq '>'; $count ? uc $1 : $1; }ge; } print $test;
print "Just another Perl ${\(trickster and hacker)},"
The Sidhekin proves Sidhe did it!
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: I don't remember regex seeming this hard before
by danderson (Beadle) on Jun 15, 2004 at 00:33 UTC |