Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
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 perusing the Monastery: (10)
As of 2015-07-07 08:33 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 (87 votes), past polls