Notepad ++常规压制,常规查找和替换

问题描述 投票:0回答:2

我有一个datebase文本文件,值用“,”分隔

2214,Bunny_Band,Bunny带,4,20,,100 ,, 2 ,, 0,0xFFFFFFFF,7,2,1024 ,, 0,1,15,{},{},{}

并且我将第9个值更改为0,第15个值为1024

regex notepad++
2个回答
0
投票
  • Ctrl + H
  • 查找内容:^(?:[^,]*,){8}\K[^,]*(?=(?:,[^,]*){5},1024,)
  • 替换为:0
  • 检查 环绕
  • CHECK 正则表达式
  • 全部替换

说明:

^                   # beginning of line
  (?:[^,]*,){8}     # non capture group, 0 or more non comma followed by comma, must appear 8 times
  \K                # forget all we have seen until this position
  [^,]*             # 0 or more non comma
  (?=               # positive lookahead, make sure we have after:
    (?:,[^,]*){5}       # 5 times a comma followed by 0 or more non comma
    ,1024,              # number 1024 surounded by comma
  )                 # end lookahead

屏幕截图(之前):

enter image description here

屏幕截图(之后):

enter image description here


-1
投票

替换:

(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),(.*),1024,(.*)

作者:

\1,\2,\3,\4,\5,\6,\7,\8,0,$10,$11,$12,$13,$14,1024,$15

窍门是,第10组以上的\不再起作用...

© www.soinside.com 2019 - 2024. All rights reserved.