Hey all. I'm pretty sure the answer to this is no, but I thought I'd better ask anyway in case there's a way I don't know about.
In perl you can use variables that you've captured in a regex after the line that the regex is on.
Example:
if($strVar =~ /I (love) nachos/)
{ print "do you $1 nachos?";
}
Will print:
do you love nachos?
So is there a way to capture values like this in PHP and use them later?
Or are you restricted to using them in the other arguments of the preg_* function?
--ed






Bookmarks