"\\DESKTOP-R052I2C\Users\CAIO\clogs\"
"\\DESKTOP-R051I4C\Users\CAIO\clogs\"
"\\DESKTOP-R053I3C\Users\CAIO\clogs\"
我怎样才能将 R 后的值更改为唯一值?
以上,致:
"\\DESKTOP-R111111\Users\CAIO\clogs\"
"\\DESKTOP-R111111\Users\CAIO\clogs\"
"\\DESKTOP-R111111\Users\CAIO\clogs\"
如果不可能,则删除 之后DESKTOP-R
和 之前的所有内容\Users
。
结果:
"\\DESKTOP-R\Users\CAIO\clogs\"
答案1
这是做的工作:
- Ctrl+H
- 找什么:
DESKTOP-R\K[^\\]+
- 用。。。来代替:
111111
- 检查环绕
- 检查正则表达式
- Replace all
解释:
DESKTOP-R # literally
\K # forget all we have seen until this position
[^\\]+ # 1 or more non backslash
给定示例的结果:
"\\DESKTOP-R111111\Users\CAIO\clogs\"
"\\DESKTOP-R111111\Users\CAIO\clogs\"
"\\DESKTOP-R111111\Users\CAIO\clogs\"
屏幕截图: