Regex replace uppercase with lowercase letters

leemour picture leemour · Dec 23, 2013 · Viewed 174.6k times · Source

I'm trying to replace uppercase letters with corresponding lowercase letters using regex. So that

EarTH:   1,
MerCury: 0.2408467,
venuS:   0.61519726,

becomes

earth:   1,
mercury: 0.2408467,
venus:   0.61519726,

in Sublime Text. How can I downcase letters only in words that contain both lower and uppercase letters? So that it affects venUs and not VENUS.

Answer

Alex K. picture Alex K. · Dec 23, 2013

You may:

Find: (\w) Replace With: \L$1

Or select the text, ctrl+K+L.