//组装一个字符串,把里面的网址解析出来 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