1

I'm trying to use regex to find all instances of a word "foo" that doesn't end with ".bar".

For example:

foo foo1 foo.bar

In the example above, I want "foo" and "foo1", but not "foo.bar". Further, I'm looking to do this using the regex capabilities of Notepad++ and am unsure of the proper syntax.

1 Answer 1

1

You can try this regex. It uses a negative lookahead to disallow the string foo from matching when followed by the string .bar.

\bfoo(?!\.bar)
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.