embperl is really not doing anything special, but the [$ $] blocks are not in
the same scope as the [+ +] blocks. use a global variable to capture the values
so it is available in the other blocks.

try:
[$ if @regex=($text =~ /(.*\s)(http\:\/\/\S+)(\s.*)/i) $]
        [+ $regex[0] +]<a href="[+ $regex[0] +]">[+ $regex[1] +]</a>[+ $regex[2] +]

Gavin Spomer wrote:

> 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 $]
>
>

--
___cliff [EMAIL PROTECTED]http://www.genwax.com/



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

Reply via email to