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
解决方案
- Ctrl+H
- 查找内容:
(?<![A-Z])([A-Z])([A-Z]+.+$)
# 第一个选项或 - 查找内容:
(?<![A-Z])([A-Z])([A-Z]+)(?![A-Z])
# 第二个选项 - 用。。。来代替:
$1\L$2
- 检查匹配案例
- 检查环绕
- 检查正则表达式
- 取消选中
. matches newline
- Replace all
解释:
第一个选项
(?<![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
屏幕截图(第一个选项):
屏幕截图(第二个选项):
推荐阅读
- git - 如何从所有未推送的 Git 提交中删除所有大于给定大小的文件?
- chisel - 如何表示 Vec 的指定索引范围?
- javascript - html页面中每张照片的下一个前一个锚点
- regex - Python 正则表达式:使用 Findall() 方法查找多个匹配项,以 | 分隔
- forms - 高级表单创建 - 需要的建议或建议
- php - Google Drive Api PHP 删除多个文件
- python - 错误:(-215:Assertion failed) !_src.empty() in function 'cv::cvtColor' in background subtrator code
- mysql - 在表已锁定的情况下执行嵌套 SQL 时,“表未使用锁定表锁定”
- postgresql - PostgreSQL 未使用 informix_fwd 创建 TCP 连接
- android - android中处理程序的post()和sendMessage()有什么区别