Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

find Word A not followed by word B,C or D.

Posted on 2012-04-13
5
Medium Priority
?
331 Views
Last Modified: 2012-06-21
What would be a regular expression for "find word A not followed by word B,C or D."?
0
Comment
Question by:deleyd
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 31

Assisted Solution

by:farzanj
farzanj earned 1336 total points
ID: 37843610
Try this:
wordA(?!.*(?:wordB|wordC|wordD))
0
 
LVL 84

Assisted Solution

by:ozo
ozo earned 664 total points
ID: 37843615
A(?!B|C|D)
0
 
LVL 84

Expert Comment

by:ozo
ID: 37843618
Do you mean not followed at all, or not followed immediately?
0
 
LVL 7

Expert Comment

by:karunamoorthy
ID: 37843620
Try this,

A*
0
 
LVL 31

Accepted Solution

by:
farzanj earned 1336 total points
ID: 37844271
For the second word immediately following the first you may have :
wordA(?!\s*(?:wordB|wordC|wordD))
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have been reconstructing a PHP-based application that has grown into a full blown interface system over the last ten years by a developer that has now gone into business for himself building websites. I am not incredibly fond of writing PHP code o…
As most anyone who uses or has come across them can attest to, regular expressions (regex) are a complicated bit of magic. Packed so succinctly within their cryptic syntax lies a great deal of power. It's not the "take over the world" kind of power,…
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…

671 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question