On Fri, Jan 31, 2003 at 12:16:49PM +0000, Mark Fowler wrote:
> On Fri, 31 Jan 2003, Lusercop wrote:
> > OK, I'm missing something, can you post an example that matches
> > arbitrarily deep bracketing in a single perl RE (and only matches if the
                                     ******
> > bracketing is valid, ie. every open has a close and vice versa).
> There's an example in the perlre man page.  It goes something like this:

[snip example]

I feel that's cheating. You also have to be much more careful than
if you were not doing it because of the lazy evaluation of the regex.

> It makes use of the (??{  }) thingy wosit to run the same regex in place
> again.

Yes, which means you can't do it in a single perl regex, you have to have
something to put in there.

> Scary, isn't it?

Yes. You also missed out the comment from my perlre(1):
| WARNING: This extended regular expression feature is considered highly
| experimental, and may be changed or deleted without notice.  A simplified
| version of the syntax may be introduced for commonly used idioms.

Since recursive bracketing is potentially something that you want to use
in production code, this is a bit worrying.

It's also not in 5.005_03, which is what my production system runs by
default.

-- 
Lusercop.net - LARTing Lusers everywhere since 2002

Reply via email to