REGEX in Notepad++ find/replace

前端 未结 2 1176
长情又很酷
长情又很酷 2021-01-26 02:39

Is it possible to use the value of a regex in the \"FIND\" part of a find/replace in Notepad++ ?

Here\'s what i have :

FIND: ^.{105}.*(.)
REPLACE: \\r\\         


        
相关标签:
2条回答
  • 2021-01-26 02:48

    You could do:

    Find what: ^(.{105}).
    Replace with: $1\r\n

    Make sure you have checked Regular expression BUT NOT dot matches newline

    then click on Replace all

    This will capture in group 1 the first 105 characters in each line.

    0 讨论(0)
  • 2021-01-26 03:00

    I think you want something along these lines:

    Find: ^(.{105}.) Replace: \1\r\n

    You need to wrap the thing in a capture group otherwise your ^ will force it to only match the beginning of the line. You'll also need to include the first capture group as part of the replacement string so it won't nuke the entire matching.

    0 讨论(0)
提交回复
热议问题