Created
November 8, 2010 15:05
-
-
Save steipete/667776 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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