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
    Yes, you're correct, it's closer to a parser (the not-an-example version is going to do a bit of regex on the contents of the <>s).

    That's a pretty spiffy, though - thanks!