469,301 Members | 2,108 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,301 developers. It's quick & easy.

Can I do a "AND NOT =" in a Regular Expression

I have an application which allows me to select records by entering a
Regular Expression in a field. With the following I can select all records
where pool = PHL-DP OR desc ends in NP, but what I need it where pool =
PHL-DP AND desc does NOT end in NP. Basically I want to exclude those
records with an NP at the end of the desc field. Can this be done with a
RE?

Thank you!
Tim

m/(^pool=PHL-DP)|(^desc=NP$)/m
Jul 19 '05 #1
1 2357
John Smith wrote:
I have an application which allows me to select records by entering a
Regular Expression in a field. With the following I can select all
records where pool = PHL-DP OR desc ends in NP, but what I need it
where pool = PHL-DP AND desc does NOT end in NP. Basically I want to
exclude those records with an NP at the end of the desc field. Can
this be done with a RE?


Should be very easy, something along the line (untested):

($pool eq 'PHL-DP' and ! $desc=~m/NP$/)

jue
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by Jeff Sandler | last post: by
2 posts views Thread by John Smith | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by suresh191 | last post: by
reply views Thread by harlem98 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.