Reputation: 1210
I want to match whole lines, here an example set:
/jome/stat/d-heme-sdfsdf/ertert ***# NOT wanted***
/jome/stat/d-heme-sdfsdf # WANTED
/jome/stat/d-gome-sdfsdf/qeqwe # NOT wanted
So I did:
(e|d|b)-(heme|gome|jome)-(.+)(?!\/)
Unfortunatly, it still matches the unwanted lines. Where is the mistake?
Upvotes: 0
Views: 1023
Reputation: 174696
If you want to use negative lookahead then place it before (.+)
and don't forget to add .*?
inside the negative lookahead.
(e|d|b)-(heme|gome|jome)-(?!.*?\/)(.+)
Upvotes: 1
Reputation: 59232
You don't require negative lookahed. .
was matching /
as well.
(e|d|b)-(he|go|jo)me-[^\/]+$
Upvotes: 2