how to replace text before the char < in every line in notepad++ using regex

时间:2017-05-16 09:31:54

标签: regex notepad++

In notepad++ I have a lot of lines, and some lines contain the character < What I want is to delete all characters before the < in each line.

I found a very similar question with answer here : How to replace all words before a particular character in a line in Notepad++
But I failed in modifying the regex with what I need.

In that answer the regex = ^[\w\s]+\=(.*)$ So I tried replacing the = by < like this ^[\w\s]+\<(.*)$ but it does not works.

here is some sample data from the document :

test123@t-online.de
'hello' <hello@apollo.com

and here is my desired outcome

test123@t-online.de
hello@apollo.com

1 个答案:

答案 0 :(得分:1)

Since you need to replace any chars up to <, you may use even simpler regex:

^.*?<

Demo: https://regex101.com/r/MCO4Gg/2