地址:http://regexkit.sourceforge.net/RegexKitLite/
正则表达式大家都知道。但是iPhone SDK居然当他不存在?这怎么能忍啊!果断用RegexKitLite。虽然叫的是Lite,但是功能很full。示例代码。
- // finds phone number in format nnn-nnn-nnnn
- NSString *regEx = @"[0-9]{3}-[0-9]{3}-[0-9]{4}";
- for(NSString *match in [textView.text componentsMatchedByRegex:regEx]) {
- NSLog(@"Phone number is %@", match);
- }
本文介绍使用RegexKitLite解决iPhoneSDK中正则表达式存在的问题,提供实例代码演示如何查找特定格式的电话号码。
4476

被折叠的 条评论
为什么被折叠?



