Reputation: 21
I want to write a regexp that selects everything except the given sequence.
I was able to write something like this: ((?!patt).)+
It works almost well, but it matches everything except the first letter. Example https://regex101.com/r/WkAo7U/1
text: "pattern noster pattern"
regexp: ((?!patt).)+
result: "attern noster attern"
wanted result: "ern noster ern"
Upvotes: 1
Views: 31