开发者

Regex: Scrub HTML

I have a bunch of 开发者_运维技巧HTML code where I want to remove all the HTML markup.

I think this is possible with Regex (Regular expression). With search and replace, how would I do this?

I tried <*> where I thought * was a wildcard, but apparently not. How would I make regex find all the

< text > ?


A simple version would be:

<[^>]+>

[] defines a character class, ^ excludes characters. Here is an example.


Take a look at this: http://haacked.com/archive/2004/10/25/usingregularexpressionstomatchhtml.aspx


Select "Regular Expression" in Search Mode. Enter [<].*?> in Find What field and leave the Replace With field empty.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜