CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Regular Expressions: Re: [jerseyguy] need some help on this 'simple' case: Edit Log



KevinR
Veteran


Oct 4, 2006, 1:57 PM


Views: 2583
Re: [jerseyguy] need some help on this 'simple' case

instead of:


Code
m/abc.*[^(123|456)]/


use:


Code
m/abc(?!123|456)/



The '?!' extension lets you specify what should not follow your pattern. You were using a negated character class which can maybe be used in some cases for this type of matching but the '?!' extension is better for what you are trying to do.

I hope I am not doing your school work for you. Frown
-------------------------------------------------


(This post was edited by KevinR on Oct 4, 2006, 1:57 PM)


Edit Log:
Post edited by KevinR (Veteran) on Oct 4, 2006, 1:57 PM


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives