Hello,
I need some help with OFRegularExpression. I have a NSString containing a bunch of html and I would like to get all of the URL's from the anchor tags.
When I run this it never returns any matches. I tried both regex Strings.
What am I missing here?
Thanks!
NSString *regexString = @"<a href=(.*?)</a>";
//NSString *regexString = @"<a.*?href=[""'](?<url>.*?)[""'].*?>(?<name>.*?)</a>";
OFRegularExpression *vOFRegex = [[OFRegularExpression alloc] initWithString:regexString];
OFRegularExpressionMatch *match = [vOFRegex matchInString:responseString];
while (match) {
NSLog([match matchString]);
match = [match nextMatch];
}
I need some help with OFRegularExpression. I have a NSString containing a bunch of html and I would like to get all of the URL's from the anchor tags.
When I run this it never returns any matches. I tried both regex Strings.
What am I missing here?
Thanks!
NSString *regexString = @"<a href=(.*?)</a>";
//NSString *regexString = @"<a.*?href=[""'](?<url>.*?)[""'].*?>(?<name>.*?)</a>";
OFRegularExpression *vOFRegex = [[OFRegularExpression alloc] initWithString:regexString];
OFRegularExpressionMatch *match = [vOFRegex matchInString:responseString];
while (match) {
NSLog([match matchString]);
match = [match nextMatch];
}