Fix project and add a RegexKitLite method replacement.

This commit is contained in:
Damiano Galassi committed 2016-07-29 14:59:11 +02:00
1 parent 5804cd49f3
commit 68bcb15b50
3 files changed
+19 -12

No files matched your search

+6
View File
@@ -53,4 +53,10 @@
return ([r matchesInString:self options:0 range:NSMakeRange(0, self.length)].count) > 0;
}
- (NSString *)MP42_stringByMatching:(NSString *)regex capture:(NSInteger)capture {
NSRegularExpression *r = [NSRegularExpression regularExpressionWithPattern:regex options:0 error:NULL];
NSTextCheckingResult *match = [r firstMatchInString:self options:0 range:NSMakeRange(0, self.length)];
return [self substringWithRange:[match rangeAtIndex:capture]];
}
@end