Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Negating Regexes: Tips, Tools, And Tricks Of The Trade

by demerphq (Chancellor)
on Dec 07, 2006 at 17:33 UTC ( #588406=note: print w/ replies, xml ) Need Help??


in reply to Re: Negating Regexes: Tips, Tools, And Tricks Of The Trade
in thread Negating Regexes: Tips, Tools, And Tricks Of The Trade

I'm not so sure that your example works as it stands. You'd need a code block to distinguish between true failure and false failure.

In perl 5.10 you could do it like:

if ( ! /...(*COMMIT:x)(*FAIL)/ && $REGERROR ne 'x' ) { ... }

To be honest I need to think about how $REGERROR will work in the context of complete failure. For instance when failure occurs because of the optimiser. Hmm.

---
$world=~s/war/peace/g


Comment on Re^2: Negating Regexes: Tips, Tools, And Tricks Of The Trade
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (4)
As of 2015-07-05 19:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (67 votes), past polls