Regex: Select everything on each line, after the first 2 letters of the beginning, but up to the dash

  • Ctrl+H
  • Find what: ^\w\w\K.+$
  • Replace with: LEAVE EMPTY
  • CHECK Wrap around
  • CHECK Regular expression
  • UNCHECK . matches newline
  • Replace all

Explanation:

^           # beginning of line
    \w\w        # 2 word character
    \K          # forget all we have seen until this position
    .+          # 1 or more any character but newline
$           # end of line

Screenshot (before):

enter image description here

Screenshot (after):

enter image description here


an alternative:

  • Ctrl+F
  • Find what: ^[a-z]{2}\K.*$
  • CHECK Wrap around
  • CHECK Regular expression
  • Find All in Current Document

OR

  • Ctrl+F
  • Find what: (?<=^.{2}).*$
  • CHECK Wrap around
  • CHECK Regular expression
  • Find All in Current Document