objective-c类别采集 Regex Categories
- 授权协议: MIT
- 开发语言: Objective-C
- 操作系统: iOS
- 软件首页: https://github.com/bendytree/Objective-C-RegEx-Categories
- 软件文档: https://github.com/bendytree/Objective-C-RegEx-Categories/blob/master/readme.md
软件介绍
Regex Categories 是一款为 NSRegularExpression 和 NSString 采集 objective-c 类别的工具,使他们可用性更高更简洁。
//Using NSRegularExpression
NSString* string = @"I have 2 dogs.";
NSRegularExpression *regex = [NSRegularExpression
regularExpressionWithPattern:@"\\d+"
options:NSRegularExpressionCaseInsensitive
error:&error];
NSTextCheckingResult *match = [regex firstMatchInString:string
options:0
range:NSMakeRange(0, [string length])];
BOOL isMatch = match != nil;
// Using this library
BOOL isMatch = [@"I have 2 dogs." isMatch:RX(@"\\d+")];
