![Notepad++ 第一个字母和最后一个字母大写](https://linux22.com/image/1621370/Notepad%2B%2B%20%E7%AC%AC%E4%B8%80%E4%B8%AA%E5%AD%97%E6%AF%8D%E5%92%8C%E6%9C%80%E5%90%8E%E4%B8%80%E4%B8%AA%E5%AD%97%E6%AF%8D%E5%A4%A7%E5%86%99.png)
我如何转换
就像这个截图 https://img.techpowerup.org/200421/test.jpg
Alfred
World
Hello
Example
Google
Testing
到
AlfreD
WorlD
HellO
Example
GooglE
TestinG
我有数百行并想全部转换像这样,谢谢。
答案1
- Ctrl+H
- 找什么:
(\w)(\w*)(\w)
- 用。。。来代替:
\u$1\E$2\u$3
- 查看 环绕
- 查看 正则表达式
- Replace all
解释:
(\w) # group 1, 1rst word character
(\w*) # group 2, 0 or more word characters
(\w) # group 3, last word character
替代品:
\u # uppercased the following
$1 # content of group 1, the 1rst letter
\E # remove uppercase
$2 # content of group 2
\u # uppercased the following
$3 # content of group 3, the last letter
截图(之前):
截图(之后):