- (BOOL)urlRegExprWithText:(NSString *)text pattern:(NSString *)pattern{
NSRegularExpression *expression = [NSRegularExpression regularExpressionWithPattern:pattern options:NSRegularExpressionCaseInsensitive error:nil];
NSArray *resultArr = [expression matchesInString:text options:NSMatchingReportCompletion range:NSMakeRange(0, text.length)];
if (resultArr.count == 0) {
return NO;
}
return YES;
}
网友评论