0

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

apple@oranges.com|cake to apple|cake
  • 2
    Which | character do you want to match? – heavyd Jul 24 '14 at 21:29
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: @|

| improve this answer | |
  • @Scott Er, yes, that's right. I was just testing you. Good work. (answer updated) – Spamwich Jul 28 '14 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

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.