Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Writing a negative regex using =~

by betterworld (Deacon)
on Oct 17, 2012 at 10:01 UTC ( #999512=note: print w/ replies, xml ) Need Help??


in reply to Writing a negative regex using =~

If I understand your problem correctly, you need a negative look-ahead:

/^(?!.*(?:GBFER|GBFOO))/

However I suggest redesigning your system so that it does not prevent you from using !~.


Comment on Re: Writing a negative regex using =~
Select or Download Code
Re^2: Writing a negative regex using =~
by ftumsh (Scribe) on Oct 17, 2012 at 10:41 UTC
    Heh, given the amount of time I've spent on the regex, that would be the better option!
Re^2: Writing a negative regex using =~
by ftumsh (Scribe) on Oct 17, 2012 at 10:53 UTC
    That's just the ticket, ta muchly!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2015-07-03 18:11 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 (55 votes), past polls