Greetings!
I have some HTML that may or may not be valid. If the HTML is invalid, a best attempt can be made, and any errors that arise are acceptable (ie, grouping too much because some tag isn't closed correctly).
In this HTML are a variety of elements, some of which may have a class (call it "findme"). These elements are of varying type; some img, some object, some a, etc.
I need a regex that will pull out all the elements, and the content they contain if they contain content.
For example:
<div>
<span><img class="findme" src="something" /></span>
<object class="findme" classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="Slider1" width="100" height="50">
<param name="BorderStyle" value="1" />
<param name="MousePointer" value="0" />
<param name="Enabled" value="1" />
<param name="Min" value="0" />
<param name="Max" value="10" />
</object>
</div>
Running the regex on that chunk of HTML should return 2 elements:
<img class="findme" src="something" />
and
<object class="findme" classid="clsid:F08DF954-8592-11D1-B16A-00C0F0283628" id="Slider1" width="100" height="50">
<param name="BorderStyle" value="1" />
<param name="MousePointer" value="0" />
<param name="Enabled" value="1" />
<param name="Min" value="0" />
<param name="Max" value="10" />
</object>
Any of you regex gurus out there have an idea on this one?
Edit: The language is c#.