Skip to content

Instantly share code, notes, and snippets.

@steipete
Created November 8, 2010 15:05
Show Gist options
  • Save steipete/667776 to your computer and use it in GitHub Desktop.
Save steipete/667776 to your computer and use it in GitHub Desktop.
// only add the http link
NSError *error = nil;
NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:@"(http[^^]+)" options:NSRegularExpressionCaseInsensitive error:&error];
NSTextCheckingResult *firstMatch = [regex firstMatchInString:responseString options:0 range:NSMakeRange(0, [responseString length])];
if (firstMatch) {
NSRange accessTokenRange = [firstMatch rangeAtIndex:1];
NSString *theUrlString = [responseString substringWithRange:accessTokenRange];
NSLog(theUrlString);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment