Parsing generic tags in C#
I need to parse text that uses various custom tags within it, for instance:
<tag>example</tag>
Everything I see on here dealing with parsing tagged stuff has some premade format (like HTML) so has a library dedicated explicitly to it. Does C# have anything that can deal with custom tags like 开发者_高级运维this? Or is the ol' "iterate through the characters and do it yourself" the best I can hope for?
edit: These tags do appear randomly in otherwise normal text, I only need to locate them or extract what is contained in them
Ugh, I can't comment! I've deactivated my addons (using latest firefox), but it is no avail. Clicking comment does nothing, only edit works. Damn, this is frustrating. I can't even view the newer comments that are coming in past the first 5!
You can try using the HTML Agility Pack - it is an HTML parser that deals with badly formed HTML, but you should be able to use it to query custom elements as well.
精彩评论