开发者

How to get html tags content

I want to get tags content in a string with regular expression. I wrote it for just one line. When the content changed into some lines from one 开发者_如何学Cline, Regex will never do pattern on the tag. I choose RegexOptions.Multiline + RegexOptions.Singleline for finding options.

My pattern in low level: (>)[ a-z A-z 0-9 ]*(</)

Thanks.


It's not cool parsing HTML with Regular Expressions. There's a .NET code library called HTML Agility Pack for that.


Are you looking for the nodeValue attribute? that should let you get the content from a div tag.

http://www.javascriptkit.com/domref/elementproperties.shtml

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜