0

Say I have the following string:

test tester tested testing

I wish to match every word that begins with test, but not the word tester. The pattern test\w* does most of the job, but I have no idea how to add that tester should not be matched. A working pattern should give 3 matches on the string.

user1151923
  • 1,853
  • 6
  • 28
  • 44

1 Answers1

1

Does this work for your purposes?

test(?!er).*
Alex Grund
  • 86
  • 7