Ok, the problem it’s that i have string with HTML. I need to find an specific format like this:
<span class="fieldText">some text</span>
of that HTML, I need to extract some text and save it into a list. How can accomplish my goal.
note that the text can appear like this
<p>
Central:
<span class="fieldText">Central_Local</span><br>Area Resolutoria:
<span class="fieldText">Area_Resolutoria</span><br>VPI:
<span class="fieldText">VIP</span><br>Ciudad: <span class="fieldText">Ciudad</span> <br>Estado: <span class="fieldText">Estado</span><br>Region <span class="fieldText">Region</span>
</p>
You can try regex:
@"<span .*?>(.*?)</span>"If you combine it with captures you can get the whole list with
@"^(.*?<span .*?>(.*?)</span>.*?)+$".But the truth is you shouldn’t use regex for XML or HTML – there is a plenty of parsers out there, as others have already mentioned.