1. 首页
  2. 数据库
  3. 其它
  4. iOS中系统自带正则表达式的应用

iOS中系统自带正则表达式的应用

上传者: 2021-02-01 19:16:49上传 PDF文件 36.19KB 热度 3次
//组装一个字符串,把里面的网址解析出来 NSString *urlString = @sfdshttp://www.baidu.com; NSError *error; //http+:[^\s]* 这是检测网址的正则表达式 NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@http+:[^\s]* options:0 error:&error]; if (regex != nil) { NSTextCheckingResult *firstMatch = [re
下载地址
用户评论