Regular Expression

  • Thread starter Thread starter Ori
  • Start date Start date
O

Ori

Hi,

I have the html content of my page and I want to extract all the
values which I have in one of my drop down list.

Does anyone know how to do it using regular expression ?


Thanks,

Ori.
 
if you just want those values that you already have in your list::
Regex r = new Regex("option|option2|option3");
MatchCollection m = r.Match(HTMLasString);

if you want each line that begins with any of those values::
Regex r = new Regex("^options|seperated|by|pipes.*?$");
MatchCollection m = r.Match(r);

good luck regex's can get pretty hairy ;)
 
Back
Top