Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Perl Regex Question

Name: Anonymous 2012-02-26 1:44

I've been using /e to execute code with something I've captured in regular expressions. Like so:

$string =~ s{(tExT)}
            { do_something($1) }eg;


However, I've been wondering if there's anything else I can do in there. Like for example, could I use if-statements in there?

Name: Anonymous 2012-02-26 2:35

>>2
Because I tried it, and it didn't work. But I was wondering if there was a way, but I was just doing it wrong.

Using $& to try to check for matches was tricky, but I got it now.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List