On Wed 06 Sep, Mark-Jason Dominus wrote:
> 
> I've been thinking the same thing.  It seems to me that the attempts to
> shoehorn parsers into regex syntax have either been unsuccessful
> (yielding an underpowered extension) or illegible or both.
> 
>SNOBOL: 
>         parenstring = '(' *parenstring ')'      
>                     | *parenstring *parenstring        
>                     | span('()')
> 
> 
> This is not exactly the same, but I tried a direct translation:
> 
>      $re = qr{ \( (??{$re}) \)
>              | (??{$re}) (??{$re})
>              | (?> [^()]+)
>              }x;
> 

I think what is needed is something along the line of :

       $re = qz{ '(' \$re ')'
                | \$re \$re
                | [^()]+
               };
               
Where qz is some hypothetical new quoting syntax

Richard

-- 

[EMAIL PROTECTED]

Reply via email to