如果至少两个或多个大写字母我想将它们更改为小写 首字母大写。我使用记事本++
示例
FLAT TOP FADE
Styling winglet curls can sometimes be a challenge
到
Flat top fade
Styling winglet curls can sometimes be a challenge
或
Flat Top Fade
Styling winglet curls can sometimes be a challenge
答案 0 :(得分:1)
(?<![A-Z])([A-Z])([A-Z]+.+$)
#1rst选项
或(?<![A-Z])([A-Z])([A-Z]+)(?![A-Z])
#第二个选项$1\L$2
. matches newline
说明:
第一个选项
(?<![A-Z]) # negative lookbeahind, make sure we haven't upper before
([A-Z]) # group 1, 1 upper
( # group 2
[A-Z]+ # 1 or more upper
.+ # 1 or more any character but newline
$ # end of line
) # end group 2
或第二个选项
(?<![A-Z]) # negative lookbeahind, make sure we haven't upper before
([A-Z]) # group 1, 1 upper
([A-Z]+) # group 2, 1 or more upper
(?![A-Z]) # negative lookahead, make sure we haven't upper after
替换: 两个选项相同
$1 # content of group 1 (the first upper letter)
\L$2 # lowercased the content of group 2, the other letters
屏幕截图(第一个选项):
屏幕截图(第二个选项):