-4

I'm using a free trial of an xml suite. However its placing random ugly data like this

 <keywords> trialsoftware-62-Trial Governing Prisons, 9780029078839, Book, Textbook</keywords>

inside random XML nodes throughout the file. I can't seem to figure out a good regex using notepad++ to delete using find replace. BTW the middle number in between is randomized. EX trialsoftware-45-Trial, trialsoftware-22-Trial etc...

Any help with a good regex to delete this info and leave the remaining data would be appreciated.

affiliatex
  • 47
  • 1
  • 7
  • @affiliatex - you need to specify in greater detail what your file looks like, and what exactly you want to find and replace. Your question is currently underspeciied. It would help if you included more sample input and desired output. – senshin Jun 14 '14 at 22:09
  • 3
    Seriously? It's a regex question, not how to circumvent or hack a program. I could pose the question in a completely different manor and get the desired result. – affiliatex Jun 14 '14 at 22:09
  • @affiliatex In my humble opinion, you should have. Anyone answering you is knowingly helping you circumvent software protection and could be found guilty under the DMCA or other applicable laws. – Pascal Cuoq Jun 14 '14 at 22:11
  • @HamZa its embarrassing but heres what I tried ^trialsoftware-..-Trial$ – affiliatex Jun 14 '14 at 22:54
  • @affiliatex That's actually a somewhat nice start. That regex doesn't work because you added anchors `^$`. `^` and `$` means begin and end of string respectively without the `m` modifier. So it naturally fails. Now just remove them and your regex should work. `.` means `match anything except newline`. So to make your regex more accurate you could use `\d\d`. `\d` means match a digit. To match one digit one or more times use `\d+`. See? You could have learned from your mistakes if you posted that regex along. You might check [this reference out](http://stackoverflow.com/q/22937618). Cheers! – HamZa Jun 14 '14 at 22:59
  • @Pascal Cuoq: Software license violations are between the provider and the consumer only. In the event that the provider decides to take action it's likely the provider will either go to Stack Exchange, or straight to the consumer, instead of going through us. It's not in the community's place to handle these cases. You can edit or ignore this question if you feel it doesn't sit right with you though - it's clear that the question can be framed in such a way that it doesn't raise unnecessary red flags. – BoltClock Jun 15 '14 at 02:42

1 Answers1

0

If I understand you correctly, this is a very simple regex. Try:

\strialsoftware-\d+-Trial\s
ooga
  • 14,368
  • 2
  • 18
  • 21