Grep pattern needed

62 views
Skip to first unread message

Otto Munters

unread,
Apr 6, 2025, 3:40:02 AM4/6/25
to BBEdit Talk
I use this Grep pattern   ^[a-z]+[\W]*$  to find lines consisting of one single word without a capital letter and including punctuation. However, BBedit also finds words that start with a capital letter. How can I correct that?

Thanks for helping!
Otto

GP

unread,
Apr 6, 2025, 5:27:04 AM4/6/25
to BBEdit Talk
If you look at the grep cheat sheet associated to "Find:" (the circled ? drop down menu) and scrolling down toward the bottom you'll find (?-i) Force case-sensitive matching. So, change you grep pattern to:

(?-i)^[a-z]+[\W]*$

and you'll find only a all-lower-case word and not any word containing a upper case letter.

Roland Küffner

unread,
Apr 7, 2025, 6:40:16 PM4/7/25
to bbe...@googlegroups.com
Just to be sure: do you have the "Case sensitive" option turned on in the Find dialog? In a quick test your pattern worked as expected … IF "Case sensitive" was turned on.

Regards, Roland

--
This is the BBEdit Talk public discussion group. If you have a feature request or believe that the application isn't working correctly, please email "sup...@barebones.com" rather than posting here. Follow @bbedit on Mastodon: <https://mastodon.social/@bbedit>
---
You received this message because you are subscribed to the Google Groups "BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bbedit+un...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bbedit/ed337435-c278-47ca-90d0-6596efc2770fn%40googlegroups.com.

Rick Gordon

unread,
Apr 7, 2025, 7:01:58 PM4/7/25
to bbe...@googlegroups.com

If you add (?-i) to the start of the string, it will work regardless of the Case-sensitive setting.

Rick Gordon


From: Roland Küffner <medien...@gmail.com>
To: bbe...@googlegroups.com
Date: Mon, Apr 7, 2025 3:39:59PM -0700
Subject: Grep pattern needed

_______________________________________
RICK GORDON
_______________________________________

EMAIL: ri...@rickgordon.com
WWW: www.shelterpub.com

Reply all
Reply to author
Forward
0 new messages