正则表达式库 RegexKitLite
- 授权协议: BSD
- 开发语言: Objective-C
- 操作系统: OS X
- 软件首页: http://regexkit.sourceforge.net/RegexKitLite/
- 软件文档: http://downloads.sourceforge.net/regexkit/RegexKitLite-4.0.pdf
软件介绍
RegexKitLite 是一个轻量级的 Objective-C 的正则表达式库,支持 Mac OS X 和 iOS,使用 ICU 库开发。
iPhone 上使用 RegexKitLite 的示例代码:
// finds phone number in format nnn-nnn-nnnn NSRange r;
NSString *regEx = @"{3}-[0-9]{3}-[0-9]{4}";
r = [textView.text rangeOfString:regEx options:NSRegularExpressionSearch];
if (r.location != NSNotFound) {
NSLog(@"Phone number is %@", [textView.text substringWithRange:r]);
}
else {
NSLog(@"Not found.");
}
