Comment on \d less efficient than [0-9]parentComments−nspragmatic13yIt happens in Objective-C: 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
Comments
It happens in Objective-C: