in reply to RegEx question
If you mean "something that isn't bank" (as you said),
/ ^ (?: .{0,3} | (?!bank}.{4} | .{5,} ) nova [ ] scotia (?: .{0,3} | (?!bank}.{4} | .{5,} ) $ /sx
Alternative:
/ ^ (?: | [^b].* | b[^a].* | ba[^n].* | ban[^k].* | bank.+ ) nova [ ] scotia (?: | [^b].* | b[^a].* | ba[^n].* | ban[^k].* | bank.+ ) $ /sx
If you mean "something that doesn't contain bank",
/ ^ (?: (?!bank). )* nova [ ] scotia (?: (?!bank). )* $ /sx
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: RegEx question
by vit (Friar) on Dec 21, 2017 at 22:41 UTC | |
by AnomalousMonk (Archbishop) on Dec 21, 2017 at 22:48 UTC | |
by vit (Friar) on Dec 21, 2017 at 23:10 UTC |