Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re^2: regular expression inverse match NOT match?

by ikegami (Pope)
on Sep 26, 2013 at 13:57 UTC ( #1055837=note: print w/ replies, xml ) Need Help??


in reply to Re: regular expression inverse match NOT match?
in thread regular expression inverse match NOT match?

If it's just spaces, then you can use

/AB\s*CDE/

But if they can be any characters except the sequence CDE, you can use

/AB(?:(?!CDE).)*CDE/s

(?:(?!PAT).)* is to PAT as [^CHAR]* is to CHAR.


Comment on Re^2: regular expression inverse match NOT match?
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2014-07-28 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (192 votes), past polls