So I have a string:
users/9881570/?access_token=
that I try to match with the regex:
NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:@"users/\\d/?access_token=" options:NSRegularExpressionCaseInsensitive error:&error];
NSArray* wordArray = [regex matchesInString:self.currentRequestURL_
options:0 range:NSMakeRange(0, [self.currentRequestURL_ length])];
However, the wordArray has a count of 0. Why is this not matching?
For one thing, you need to escape the question mark, and for another you need a plus sign (+) after your \d to indicate 1 or more numbers. As it is now you only look for one digit.