Skip to content

Instantly share code, notes, and snippets.

@dnnta
Last active Dec 10, 2015
Embed
What would you like to do?
去掉Html标签
NSString *htmlStr = @"This is a <br />string with html <strong>tag</strong>.";
NSRange range;
while ((range = [htmlStr rangeOfString:@"< [^>]+>" options:NSRegularExpressionSearch]).location != NSNotFound){
htmlStr = [htmlStr stringByReplacingCharactersInRange:range withString:@""];
}
<p [stylealign]{5}=".*?">.*?<img.*?src="(.*?)".*?/>.*?</p>[\r\n]+<p [stylealign]{5}=".*?">[\r\n\s]*?(.*?)</p>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment