(no title)
nspragmatic | 12 years ago
NSString *pattern = @"\\d", *string = @"੧";
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern
options:NSRegularExpressionCaseInsensitive
error:nil];
NSUInteger numMatches = [regex numberOfMatchesInString:string
options:0
range:NSMakeRange(0, [string length])];
numMatches ? NSLog(@"%@ found by %@", string, pattern) : NSLog(@"%@ not found", string);
// 2013-05-20 09:38:42.650 Regexperiment[17848:c07] ੧ found by \d
No comments yet.