Analizowanie HTML NSRegularExpression

próbuję przeanalizować stronę HTML za pomocą NSRegularExpressions .. Strona jest powtórzeniem tego kodu HTML:

<code><div class="fact" id="fact66">STRING THAT I WANT</div> <div class="vote">
<a href="index.php?p=detail_fact&fact=106">#106</a> &nbsp; &nbsp; 
<span id="p106">246080 / 8.59  </span> &nbsp; &nbsp;
<span id="f106" class="vote2">
<a href="#" onclick="xajax_voter(106,3); return false;">(+++)</a> 
<a href="#" onclick="xajax_voter(106,2); return false;">(++)</a>  
<a href="#" onclick="xajax_voter(106,1); return false;">(+)</a> 
<a href="#" onclick="xajax_berk(106); return false;">(-)</a></span>
<span id="ve106"></span>
</div>
</code>

Więc chciałbym uzyskać ciąg między div

<code> <div class="fact" id="fact66">STRING THAT I WANT</div>
</code>

Zrobiłem więc wyrażenie regularne, które wygląda tak

<code><div class="fact" id="fact[0-9].*\">(.*)</div>
</code>

Teraz w moim kodzie implementuję go za pomocą tego:

<code>    NSString *htmlString = [NSString stringWithContentsOfURL:[NSURL URLWithString:@"http://www.myurl.com"] encoding:NSASCIIStringEncoding error:nil];
NSRegularExpression* myRegex = [[NSRegularExpression alloc] initWithPattern:@"<div class=\"fact\" id=\"fact[0-9].*\">(.*)</div>\n" options:0 error:nil];
    [myRegex enumerateMatchesInString:htmlString options:0 range:NSMakeRange(0, [htmlString length]) usingBlock:^(NSTextCheckingResult *match, NSMatchingFlags flags, BOOL *stop) {
        NSRange range = [match rangeAtIndex:1];
        NSString *string =[htmlString substringWithRange:range];
        NSLog(string);
    }];
</code>

Ale nic nie zwraca ... Przetestowałem mój regex w Javie i PHP i działa świetnie, co robię źle?

Dzięki

questionAnswers(1)

yourAnswerToTheQuestion