Notepad++ RegEx Inquiry

by 5 replies
6
Hello. I need help in finding the right regex formula using Notepad++'s find & replace feature to trim some data I have.

Here's my problem. I have lines in N++ like this:

</td2898>MONKEY</tfeai35uefd>
</tie1gaod>PENGUIN</tgeo2ad>

I want to manipulate the data so it reads this:

MONKEY
PENGUIN

Does anyone know how? I've been attempting to solve this problem for about 2 hours now with no luck. Any help would be much appreciated.
#programming #inquiry #notepad #regex
  • If I understand you correctly you should be able to hit CTRL + H then copy paste the tags one by one Into the Find what: field and leave the bottom field blank then click replace all. That should clear them out for you.
  • Thanks for the reply, Proudmoor. You are understanding me correctly, however, in my case I have several thousand lines of code that need this treatment so that would take awhile, haha.
    • [1] reply
    • I don't know about a regex solution (regex makes my brain hurt, lol), but it's easy to accomplish this using spreadsheet software. I'll use OpenOffice Calc in this example, but I think the process is pretty similar in MS Office.

      First, put your data in a plain text file and then save it with a "csv" extension (ie data.csv).

      Next, open up Calc and load the csv file. You should then see a popup that says "Text Import" with a bunch of different options. In the "Separated by" part, check "other", and then use...



      ...for the "other" valu
    • Choose Search | Replace (or ctrl + H)
    • Find What = [<].*?>
    • Replace = BLANK
    • Search Mode = Regular Expressions

    That worked for me with the data you supplied
    • [ 1 ] Thanks
    • [1] reply
    • Thanks for the input, Brandon. I haven't used OpenOffice calc but perhaps I should give it a go.

      BobbyF, that works! MUCH appreciated.

      Thank you, guys.

Next Topics on Trending Feed

  • 6

    Hello. I need help in finding the right regex formula using Notepad++'s find & replace feature to trim some data I have. Here's my problem. I have lines in N++ like this: