Regex replace uppercase with lowercase letters

前端 未结 6 1502
孤独总比滥情好
孤独总比滥情好 2020-12-04 05:14

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

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


        
6条回答
  •  有刺的猬
    2020-12-04 05:18

    I figured this might come in handy for others as well :

    find:

    • ([A-Z])(.*)

    replace:

    • \L$1$2 --> will convert all letters in $1 and $2 to lowercase
      BUT
    • \l$1$2 --> will only convert the first letter of $1 to lowercase and leave everything else as is

    The same goes for uppercase with \U and \u

提交回复
热议问题