Sublime text: How to do sentence case (capitalize the first letter of a sentence)
You can use this regex:
find
(^|\.\s|…\s)([a-z])
and replace with
\1\u\2
Explanation:
- The first find group (parénthesis group) captures a line beginning or a dot followed by a space or three dots character followed by a space.
- The second group captures a letter.
- In the replace expresion \1 and \2 refer to the captured groups.
- \u means translate one character to uppercase.
- This capitalizes lines starting with a character and sentences starting after other sentences.
Find:
<h4>(.)(.*)</h4>
Replace:
<h4>\u\1\L\2</h4>
That would make
<h4>This Is A Demo</h4>
into
<h4>This is a demo</h4>