我有这个网址
https://www.mirrored.to/files/12345678/abcdefgh
我需要将这个替换为字母表 2 之前的空格
https://www.mirrored.to/files/12345678 abcdefgh
答案1
答案2
假设你有一个 URL 或多个 URL 逐行保存在一个文本文件中
https://www.mirrored.to/files/12345678/abcdefgh
https://superuser.com/questions/1807813/insert-a-space-in-line-after-notepad
https://stackoverflow.com/questions/76245266/adding-characters-to-the-first
https://www.mirrored.to/files/12345678/ABCDEFGH
您需要执行以下步骤:
- Ctrl+H
- 找什么:
^(.+\d)(\/)(.+$)
- 用。。。来代替:
$1 $3
- 勾选环绕选项
- 搜索模式:正则表达式
- 点击Replace All(风险自负)
解释:
^ asserts position at start of a line
1st Capturing Group (.+\d)
. # matches any character (except for line terminators)
+ # matches the previous token between one and unlimited times
\d # matches a digit (equivalent to [0-9])
2nd Capturing Group (\/)
\/ # matches the character /
3rd Capturing Group (.+$)
. # matches any character (except for line terminators)
+ # matches the previous token between one and unlimited times
$ # asserts position at the end of a line
截图(之前):
截图(之后):