Notepad++ 在倒数第二个字符前插入 0

BDF*_*BDF 2 notepad++ regex

我有一个这样的列表:

2044
2045
2046
103
106
109
Run Code Online (Sandbox Code Playgroud)

在任何 3 位数字长的行上,我只想在倒数第二个数字之前插入“0”。

2044、2045、2046 被保留,103 个更改为 1003、1006、1009。

在 Notepad++ Regex 中,我有 Find: ^[0-9][0-9][0-9]$ ,它似乎突出显示了所有三位数字行,但我坚持在这些行的倒数第二个之前插入 0。

感谢您的时间!

Att*_*tie 5

您需要使用正则表达式“捕获组”(之间的任何匹配())和“反向引用”来获取捕获的文本(\1\2以下)。

访问 regex101.com 等网站,该网站还会为您解释 Regex:

后:

2044
2045
2046
1003
1006
1009
Run Code Online (Sandbox Code Playgroud)