Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 340
  • Last Modified:

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

What would be a regular expression for "find word A not followed by word B,C or D."?
0
deleyd
Asked:
deleyd
  • 2
  • 2
3 Solutions
 
farzanjCommented:
Try this:
wordA(?!.*(?:wordB|wordC|wordD))
0
 
ozoCommented:
A(?!B|C|D)
0
 
ozoCommented:
Do you mean not followed at all, or not followed immediately?
0
 
karunamoorthyCommented:
Try this,

A*
0
 
farzanjCommented:
For the second word immediately following the first you may have :
wordA(?!\s*(?:wordB|wordC|wordD))
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now