0

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 command if i want remove all (things) before (something) and all (things) after.

Thanks

1
  • Voted to close. While regular expressions are often used in software development, this is not a programming question.
    – Cᴏʀʏ
    May 5, 2011 at 18:05

4 Answers 4

4

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!

2
  • Thank you all, the thread commands are working perfect, this will save a lot of my time.
    – Manal Nor
    May 5, 2011 at 16:26
  • 3
    @Manal Nor you should mark SoreThumbs answer as the accepted answer by clicking the checkmark beside his answer.
    – Toby Allen
    May 5, 2011 at 17:42
1

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

0

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

 .*>(.*)<.* 

with

\1
0

I went with:

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

\2

and that seemed to work for me.

or just

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

\1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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