Does embperl have it's own $1, $2, etc. like the ones captured when using parenthesis 
in a matching expression? If not, does embperl do something to these 
variables produced by the parenthesis (like discard or ignore them)? To illustrate 
what I'm talking about here's some embperl code:

[- $text = 'This: http://www.blah.com is a url'; -]

[$ if $text =~ /(.*\s)(http\:\/\/\S+)(\s.*)/i $]
        [+ $1 +]<a href="[+ $2 +]">[+ $2 +]</a>[+ $3 +]
[$ else $]
        [+ $text +]
[$ endif $]

Which, I don't know why, produces the output:

<a href=""></a>

The equivelant (I think) non-embedded perl code:

$text = 'This: http://www.blah.com is a url';

if ($text =~ /(.*\s)(http\:\/\/\S+)(\s.*)/i )
{
        print "$1<a href=\"$2\">$2<\/a>$3\n";
}
else
{
        print "$text\n";
}

outputs what I am trying to achieve w/ the embperl code:

This: <a href="http://www.blah.com">http://www.blah.com</a> is a url

so why doesn't the embperl version work?

- Gavin

"People are the worst drivers in the world" 
http://www.singlespeedsanonymous.com/

Join PayPal and get FIVE FREE DOLLARS (no joke!):
https://secure.paypal.x.com/refer/pal=gavinspomer%40hotmail.com
... and it's a very usefull account to have!




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to