0

Basically I have a list of items in the format

item1:item2:item3

and I need to remove all the item1's to make it look like this.

item2:item3

I have most text editors so which ever one suits best let me know, thanks.

(p.s. all of the item's are different, none are the same, including those in the same item catagory)

Joe
  • 1

1 Answers1

1
  • Ctrl+H
  • Find what: ^.+?:(.*\R)
  • Replace with: $1
  • check Wrap around
  • check Regular expression
  • UNCHECK . matches newline
  • Replace all

Explanation:

^               # beginning of line
    .+?         # 1 or more any character but newline, not greedy
    :           # a colon
    (.*\R)      # 0 or more any character but newline, followed by any kind of linebreak

Replacement:

$1          # content of group 1 (i.e. everything that is after the first colon)

Given:

item1:item2:item3
item2:item1:item3
item3:item2:item1

Result for given example:

item2:item3
item1:item3
item2:item1

Screen capture: enter image description here

Toto
  • 19,304