tmajor99
asked on
Regular Expression to find multiple words
I need a regular expression that will check if a string contains words "Wall Mount" and ("Inwall or "in-wall" or "in wall").
Data
-------------------------- ---------- ---------- ---
Wall Mount (Inwall Frame/Plate) Match
Wall (Inwall) Not Matched
Wall Mount (In-Wall) Match
Wall Mount InWall Match
In Wall MNT Not Match
IN-WALL (WALL Mount) Match
Data
--------------------------
Wall Mount (Inwall Frame/Plate) Match
Wall (Inwall) Not Matched
Wall Mount (In-Wall) Match
Wall Mount InWall Match
In Wall MNT Not Match
IN-WALL (WALL Mount) Match
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
And if you want the chunks you are matching to be disjoint "words" and not allow subwords, like
thinwall Wall Mounting
the try:
»bp
thinwall Wall Mounting
the try:
(?i)(?=.*\bwall\s+mount\b)(?=.*\bin[-\s]*wall\b)
»bp
@tmajor99,
Are you all set with this now, or do you need more help? If all set, could you please close it out now. If you need help with the question close process take a look at:
»bp
Are you all set with this now, or do you need more help? If all set, could you please close it out now. If you need help with the question close process take a look at:
»bp
Open in new window
»bp