开发者

Using regular expressions to do mass replace in Notepad++

开发者 https://www.devze.com 2023-03-04 09:36 出处:网络
If we have the following lines <something>A<else> <something>B<else> <something>C<else>

If we have the following lines

<something>A<else>
<something>B<else>
<something>C<else>

Using regular expressions in Notepad++ how to remove all and keeps the letters to be

A
B
C

I've used to replce (.*)(>)(.*) by \3 but didn't worked so anyway what would be the开发者_如何学JAVA command if i want remove all (things) before (something) and all (things) after.

Thanks


Dear Manal Nor, welcome to Stack Overflow!

I achieved the above result using the following code in Notepad++ 5.6.8:

"FIND WHAT":

<[^>]+>([^<]*)<[^>]+>

"REPLACE WITH":

\1

Let me know if it works!


try search ^.*>(.*)<.*$ and replace \1


I don't have the program here but try something like replacing

 .*>(.*)<.* 

with

\1


I went with:

(<.*>)(.*)(<.*>)

\2

and that seemed to work for me.

or just

<.*>(.*)<.*>

\1
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号