Steve
Steve

Reputation: 14922

Sublime Text: Regex to convert Uppercase to Title Case?

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?

Upvotes: 62

Views: 40888

Answers (2)

garyh
garyh

Reputation: 2852

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).

Upvotes: 98

Alexander Wigmore
Alexander Wigmore

Reputation: 3186

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

Edit -> Convert Case -> Title Case

Upvotes: 26

Related Questions