Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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

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 having an uproarious good time at the Monastery: (7)
As of 2016-08-31 06:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (426 votes). Check out past polls.