Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Regex 记事本++;定期的压制,定期的发现和替换_Regex_Notepad++ - Fatal编程技术网

Regex 记事本++;定期的压制,定期的发现和替换

Regex 记事本++;定期的压制,定期的发现和替换,regex,notepad++,Regex,Notepad++,我有一个数据库文本文件,值用“,”分隔 2214,小兔子乐队,小兔子 波段,4,20,100,2,,0,0xFFFFFFFF,7,2,1024,,0,1,15,{},{},{ 我会把第9个值改为0,其中第15个值是1024 Ctrl+H 查找内容:^(?:[^,]*,){8}\K[^,]*(?=(?:,[^,]*){5},1024,) 替换为:0 检查环绕 检查正则表达式 全部替换 说明: ^ # beginning of line (?:[^,]*,)

我有一个数据库文本文件,值用“,”分隔

2214,小兔子乐队,小兔子 波段,4,20,100,2,,0,0xFFFFFFFF,7,2,1024,,0,1,15,{},{},{

我会把第9个值改为0,其中第15个值是1024
  • Ctrl+H
  • 查找内容:
    ^(?:[^,]*,){8}\K[^,]*(?=(?:,[^,]*){5},1024,)
  • 替换为:
    0
  • 检查环绕
  • 检查正则表达式
  • 全部替换
  • 说明:

    ^                   # 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
    
    屏幕截图(之前):

    ^                   # 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
    

    屏幕截图(之后):

    ^                   # 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