Sublime Text: Regex to convert Uppercase to Title Case?

RegexStringSublimetextSublimetext3

Regex Problem Overview


I have a bunch of labels in a text file (e.g. MY LABEL:) that I need to make title case.

I already know how I would make them all lower or upper case.

For example:

^([A-Z &#]+:) to \L$1

However, is there a simple switch-based way to get title case?

Regex Solutions


Solution 1 - Regex

Find: ([A-Z])([A-Z]+)\b

Replace: $1\L$2

Make sure case sensitivity is on (Alt + C) and preserve case is off (Alt + A).

Solution 2 - Regex

Have you tried the Sublime Text built in? Edit -> Convert Case -> Title Case.

Edit -> Convert Case -> Title Case

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionSteveView Question on Stackoverflow
Solution 1 - RegexgaryhView Answer on Stackoverflow
Solution 2 - RegexAlexander WigmoreView Answer on Stackoverflow