1

im having a little difficulty in making a regex that will filter an input for me.

if i get a lot of: <option value=1234>text</option><option value=5678>text2</option> (note that the number is always 4 digits) and i want the regex to filter the text for me, so i'll have a list of "text\ntext2" etc, what regex expression do i have to use? im kind of new to regex and i cant figure it out by myself..

thanks in advance!

T4u
  • 291
  • 2
  • 8

2 Answers2

2

Something like this:

<option value=\d+>([\w\s\\]+)</option>
Sam Starling
  • 5,298
  • 3
  • 35
  • 52
1

I assume you want to search replace within notepad++.

Search for

<option value=\d+>(.*?)</option>

and replace with

\1\n
stema
  • 90,351
  • 20
  • 107
  • 135
  • Great regex, i haven't tried it because i already managed to do that i wanted, but it might make , to: text . i would try (i havent tried it and im new to regex) to go with: so it will search 'text' until it hops into a '<' – T4u Apr 28 '11 at 10:22
  • Then instead of `` use ``. – stema Apr 28 '11 at 10:29