Capitalizing the first letter after a colon

16 views
Skip to first unread message

K in KOP

unread,
Nov 17, 2024, 4:23:20 PM11/17/24
to TextSoap
I'd like to create a cleaner (not sure if that's the right terminology) that will automatically capitalizing the first letter after a colon?

changes this:    Marty: blah blah blah
to this:                Marty: Blah blah blah

thank you

K in KOP

unread,
Feb 10, 2025, 11:29:41 AMFeb 10
to TextSoap
hopefully bumping this to see if there's a solution. Thanks!

Mark Munz

unread,
Feb 11, 2025, 9:12:31 AMFeb 11
to text...@googlegroups.com
Apologies. I must have missed this one.

Create a cleaner and add an action like this:
image.png

^ - anchor match to the start of the line (with m option)
(.*?:\s+) - match & capture any characters (.*?) up until the colon (:) followed by one or more whitespace (\s+)
  note: if there are cases of no spaces after the colon, change it to \s*
(\w) - match & capture the next word character

The parens ( ) within the expression capture the parts of the match that you'll use later. In this case, we have two.

In the replacement, we use a transform option to uppercase the next letter ($u)

$1$u$2 - replace with first capture group, indicate the next character is uppercase, then the next capture group


--
You received this message because you are subscribed to the Google Groups "TextSoap" group.
To unsubscribe from this group and stop receiving emails from it, send an email to textsoap+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/textsoap/67fab231-e6bc-45c2-b0d0-8e28d1d06ad0n%40googlegroups.com.


--
Mark Munz
unmarked software
https://textsoap.com/

Reply all
Reply to author
Forward
0 new messages