Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: regex bug in perl 5.8.7

by diotalevi (Canon)
on May 25, 2007 at 23:22 UTC ( [id://617624]=note: print w/replies, xml ) Need Help??


in reply to regex bug in perl 5.8.7

You need a re-entrant regexp engine to do what you tried. I don't think even the latest bleads are. Also, your pattern isn't terribly meaningful. Are you *sure* you meant to use the return value of a boolean regexp as another regexp pattern to compile and apply?

⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

Replies are listed 'Best First'.
Re^2: regex bug in perl 5.8.7
by imp (Priest) on May 25, 2007 at 23:44 UTC
    The pattern isn't meant to be meaningful. The regex I listed was already reduced to the simplest case I could find that still caused a segfault. The original form was much different.

      In the future, you might want to use the (?{...}) form instead since that has no implications for compiling and interpolating another regexp.

      ⠤⠤ ⠙⠊⠕⠞⠁⠇⠑⠧⠊

        The regex that originally triggered the segfault was an attempt at a joke that used a modified version of the regex I wrote in this node.

        The joke was that someone in an irc channel at work said "<3", and someone else asked what the opposite of "<3" was. My response was qr[(??{/^<3/?qr/\A\z/:qr//;})]

        Which is this when written in a legible manner:

        my $negative = qr[ (??{ /^<3/ ? qr/\A\z/ : qr//; }) ]x;
        Which segfaulted, but only when the text being searched started with '<3'. After a little exploration I found the minimal regex that still segfaulted, and posted about it.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://617624]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (None)
    As of 2024-04-25 03:56 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      No recent polls found