0

I have a problem. In notepad++ When I to clear everything behind : in replacement, I did ^[^:]+: But the problem is that the format of lines is name1:name2:name3 And I would like to remove the name1: so I would just have name2:name3 Any ideas?

OKO
  • 1

1 Answers1

2

It seems it's a bug :( in Npp, use the following:

  • Ctrl+H
  • Find what: ^[^:\r\n]+:(.+)$
  • Replace with: $1
  • CHECK Wrap around
  • CHECK Regular expression
  • UNCHECK . matches newline
  • Replace all

Explanation:

^               # beginning of line
  [^:\r\n]+     # 1 or more not colon or linebreak
  :             # a colon
  (.+)          # group 1, 1 or more any character but newline
$               # end of line

Replacement:

$1          # content of group 1

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here

Toto
  • 89,455
  • 62
  • 89
  • 125