How I can find html element by id or class in string?(regex,C#)
<div class="item1">content</div>
<div class="item2">content</div>
get only
<div class="item1">
If you want to take only div - try this
<div (class|id)="myClassNameOrId".*?>
instead of myClassNameOrId
input your own class or id name.
If you want take other elements - replace div
to other tag's name.
` is valid HTML, but not valid XML). A good option is the HAP which also deals with malformed documents and document fragments. – Oded Nov 26 '12 at 12:38