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

J

John Smith

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
 
J

Jürgen Exner

John said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top