How to find a string and exclude certain matches

37 views
Skip to first unread message

Allen Hancock

unread,
Jun 15, 2025, 3:38:07 PMJun 15
to BBEdit Talk
I have a folder with many files which match the string "server" and "serverkey" or "observer"

How would I do a search which finds the words "server" but skips the others?


Rich Siegel

unread,
Jun 15, 2025, 3:40:23 PMJun 15
to 'Allen Hancock' via BBEdit Talk
"Entire word" will accomplish this.

R.


--
Rich Siegel Bare Bones Software, Inc.
<sie...@barebones.com> <https://www.barebones.com/>

Someday I'll look back on all this and laugh... until they sedate me.

Allen Hancock

unread,
Jun 15, 2025, 4:37:38 PMJun 15
to BBEdit Talk

Brilliant, thank you!

Allen Hancock

unread,
Jun 15, 2025, 8:26:46 PMJun 15
to BBEdit Talk

I noticed the phrase "Server Key" show up in searches, which makes sense because it's a full word match.

Asking more for the purpose of future search needs.. is there a way to find "phrase1" but not "phrase2"

Rick Gordon

unread,
Jun 15, 2025, 8:51:51 PMJun 15
to bbedit

\bserver\b(?! Key)

Rick Gordon


From: "'Allen Hancock' via BBEdit Talk" <bbe...@googlegroups.com>
To: BBEdit Talk <bbe...@googlegroups.com>
Date: Sun, Jun 15, 2025 5:26:45PM -0700
Subject: How to find a string and exclude certain matches

I noticed the phrase "Server Key" show up in searches, which makes sense because it's a full word match.

Asking more for the purpose of future search needs.. is there a way to find "phrase1" but not "phrase2"

_______________________________________
RICK GORDON
_______________________________________

EMAIL: ri...@rickgordon.com

Allen Hancock

unread,
Jun 16, 2025, 10:15:46 AMJun 16
to BBEdit Talk
Thank you all!
-Allen

Reply all
Reply to author
Forward
0 new messages