0

How do I remove portion of each line from "@" to "|" in notepad++

[email protected]|cake to apple|cake
1
  • 2
    Which | character do you want to match?
    – heavyd
    Jul 24, 2014 at 21:29

2 Answers 2

2

Like heavyd suggested, it depends which | you want to match.

DBZ_A's solution will give you the greedy (as long as possible) match.

This will give you the lazy (shorter) match, which I suspect you want

Find what: @[^\|]*\|

(This should match an @, followed by any number of characters that are not |, followed by |)

Replace with: @|

1
  • @Scott Er, yes, that's right. I was just testing you. Good work. (answer updated)
    – Spamwich
    Jul 28, 2014 at 22:21
1

Use 'Regular expression' option in find and replace dialogue

search for :

@(.*)\|

replace with:

@|

Note that the | character needs to be escaped as \| in the search string

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .