如果至少两个或多个大写字母我想将它们更改为小写

时间:2019-09-21 15:03:55

标签: notepad++

如果至少两个或多个大写字母我想将它们更改为小写 首字母大写。我使用记事本++

  

示例

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

1 个答案:

答案 0 :(得分:1)

  • Ctrl + H
  • 查找内容:(?<![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

屏幕截图(第一个选项):

enter image description here

屏幕截图(第二个选项):

enter image description here