Regular Expression Help
Posted on 2004-11-16
I have this regular expression: <\s*(div)\s*([^/>]*)(?:>(.*?)</\1>|/>) which seems to match div tags which is nice, however i need it to also match span tags.
In fact, it would be handy if it worked the other way round, given the string "aboutContent" it could match all tags that contain the id "aboutContent" ie;
<div id="aboutContent" class="maybe_a_class">some text here</div>
<span id="aboutContent">blah de blah</span>
once i have the complete string as above, would great if i could break it down into:
tag = "div"
id = "aboutContent"
class = "maybe_a_class"
content = "blah de blah"
in c# for a gold star :)