RegexKitLite 介绍
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.”);
}
RegexKitLite 官网
http://regexkit.sourceforge.net/RegexKitLite/
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。