c# - How to retrieve data from an html string from a span tag by using Regular Expressions? -
i need retrieve info html doc since web service json or xml still not ready. im working c# , using regular expressions data need html string. i've managed div want work whole html string i'm having trouble getting info between first span tag. i've attempted retrieve data between ; , first closing span tag want content between first span tag.
here's regular expression i've written far, it's not working:
".*;(?<content>(\r|\n|.)*)</span>" i tried didnt work either:
"<span class=""type"">(?<content>(\r|\n|.)*)</span>" here div want retrieve data from:
<div class="main">abasasdfÓ 18/06/2014 17:38h blabla balbal <span class="type">15.80€ </span>+1.94 % +0.30€ | home <span class="type2">11,398.70</span> +0.65 % +74.10</div> edit: can't use htmlagilitypack since client not want use external library. i've heard using xmlreader i'm not sure structure of html match xml 1 accordingly.
this regex capture string:
"<span class=\"type\">(?<content>([^<]*))</span>" although, agree other answers, should use path instead of regexes parsing html.
Comments
Post a Comment