如何在数字和引号之间插入冒号?

时间:2019-11-26 18:09:57

标签: regex notepad++

来源:

9981"TVHeadend HTTP server (web interface)"

并在两者之间添加冒号以制作python词典!

但是这些是注册的已知IP地址,太多了,一次只能做一个!

我尝试替换相同的查找并添加:,但是它用正则表达式代码替换了数字!

不确定我的代码是否正确!

我还想找到第一个双引号,因为您可以看到每一行都有两个!

1 个答案:

答案 0 :(得分:2)

  • Ctrl + H
  • 查找内容:\d+\K(?=")
  • 替换为::
  • 检查 环绕
  • 检查 正则表达式
  • 全部替换

说明:

\d+             # 1 or more digits
\K              # forget all we have seen until this position
(?=")           # positive lookahead, make sure we have a double quote after

屏幕截图(之前):

enter image description here

屏幕截图(之后):

enter image description here

相关问题