GREP: lower case > upper case

69 views
Skip to first unread message

Samuel Arnet

unread,
Jan 22, 2025, 3:52:52 AM1/22/25
to BBEdit Talk
I need a GREP to find each lower case character at the beginning of a line and replace it with its uppercase counterpart.

So I search for

^([[:lower:]])

What do I write in the Replace field?

Thanks
Sam

Alberto Gutiérrez

unread,
Jan 22, 2025, 4:39:10 AM1/22/25
to BBEdit Talk
Hi, Sam. Type this in the replace field:

\U\1

(uppercase to the group 1 found)

Watts Martin

unread,
Jan 22, 2025, 9:59:49 AM1/22/25
to bbe...@googlegroups.com
Depending on what it is you’re doing, you may not need to use regular expressions for this at all. You can select the lines you want to capitalize (or Select All), and then use “Capitalize Lines” (seleect Text > Change Case > Capitalize Lines in the menu, or use the command palette).
> --
> 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/d4cafcad-296a-43ac-885e-c4966ba3e7ab%40bluewin.ch.

Samuel Arnet

unread,
Jan 22, 2025, 1:45:43 PM1/22/25
to bbe...@googlegroups.com
Thank you both for your help. The GREP replacement works perfectly. (The Capitalize Lines approach does capitalise the first letter but also lowercases the rest of the words in a line.)

Sam

Reply all
Reply to author
Forward
0 new messages