Skip to content

Instantly share code, notes, and snippets.

@dnnta
Last active December 10, 2015 00:29
Show Gist options
  • Save dnnta/4351830 to your computer and use it in GitHub Desktop.
Save dnnta/4351830 to your computer and use it in GitHub Desktop.
去掉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