+ (NSString *) paramValueOfUrl:(NSString *) url withParam:(NSString *) param{
NSError?*error;
NSString?*regTags=[[NSString?alloc]?initWithFormat:@"(^|&|\\?)+%@=+([^&]*)(&|$)",param];
NSRegularExpression?*regex?=?[NSRegularExpression?regularExpressionWithPattern:regTags
options:NSRegularExpressionCaseInsensitive
error:&error];
//?執(zhí)行匹配的過程
NSArray?*matches?=?[regex?matchesInString:url
options:0
range:NSMakeRange(0,?[url?length])];
for?(NSTextCheckingResult?*match?in?matches)?{
NSString?*tagValue?=?[url?substringWithRange:[match?rangeAtIndex:2]];? //?分組2所對(duì)應(yīng)的串
return?tagValue;
}
return?nil;
}