RegExp

  • Thread starter Thread starter Steffan A. Cline
  • Start date Start date
S

Steffan A. Cline

I am an amateur at best with regexp. I am trying to search for a string
like:

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPD..." />

Within an html document and get the value of value="xxx".

I have this:

Match _viewstateValue = Regex.Match(content, "<input .*?id=\"__VIEWSTATE\"
..*?value=\"([^\"].*)");

But it returns just the whole line not the value... I'm stuck. What is the
best way to drill all the way down to that value?

Thanks,

Steffan
 
I am an amateur at best with regexp. I am trying to search for a string
like:

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPD..." />

Within an html document and get the value of value="xxx".

I have this:

Match _viewstateValue = Regex.Match(content, "<input .*?id=\"__VIEWSTATE\"
.*?value=\"([^\"].*)");

But it returns just the whole line not the value...
Yes, this is because what your regexp matches...
You might want to use $1
 
(e-mail address removed),
GArlington at (e-mail address removed) wrote on 7/11/08 5:48 AM:
I am an amateur at best with regexp. I am trying to search for a string
like:

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPD..." />

Within an html document and get the value of value="xxx".

I have this:

Match _viewstateValue = Regex.Match(content, "<input .*?id=\"__VIEWSTATE\"
.*?value=\"([^\"].*)");

But it returns just the whole line not the value...
Yes, this is because what your regexp matches...
You might want to use $1
I'm stuck. What is the
best way to drill all the way down to that value?

Thanks,

Steffan
How would I format this?

Thanks,
Steffan
 
(e-mail address removed),
GArlington at (e-mail address removed) wrote on 7/11/08 5:48 AM:
I am an amateur at best with regexp. I am trying to search for a string
like:

<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPD..." />

Within an html document and get the value of value="xxx".

I have this:

Match _viewstateValue = Regex.Match(content, "<input .*?id=\"__VIEWSTATE\"
.*?value=\"([^\"].*)");

But it returns just the whole line not the value...
Yes, this is because what your regexp matches...
You might want to use $1
I'm stuck. What is the
best way to drill all the way down to that value?

Thanks,

Steffan
How would I format this regexp? Still with Regex.Match ?

Thanks,

Steffan
 
Back
Top