Skip to content

Instantly share code, notes, and snippets.

@ada-lovecraft
Created May 21, 2013 20:48
Show Gist options
  • Save ada-lovecraft/5623115 to your computer and use it in GitHub Desktop.
Save ada-lovecraft/5623115 to your computer and use it in GitHub Desktop.
failed Regex
NSError *error = NULL;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(<[^>]+?>|{{[^}]+?}})" options:0 error:&error];
NSString *result = [regex stringByReplacingMatchesInString:contents options:0 range:NSMakeRange(0, [contents length]) withTemplate:@""];
NSLog(@"%@",result);
@ada-lovecraft
Copy link
Author

The correct string is: @"(<[^>]+?>|{{[^\}]+?}})"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment