I've finally found it out. I decided to use NSXML instead of Regex and it works perfectly.

NSXMLNode *recived = [[[NSXMLDocument alloc] initWithData:receivedData options:NSXMLDocumentTidyHTML error:NULL] rootElement];
NSArray *recivedA = [recived nodesForXPath:@"//a" error:nil];
int i;
for (i=0; i<[recivedA count]; i++) {
        NSXMLElement *link = [recivedA objectAtIndex:i];
        NSLog(@"%@", [[link attributeForName:@"href"] stringValue]);
}

Thanks,
Mr. Gecko

On Nov 18, 2008, at 2:02 PM, [EMAIL PROTECTED] wrote:

NSPredicate can handle ICU standard regex matches.
More info in the NSPredicate docs.
The following snippet validates a UUID.

/*

is UUID

see http://www.stiefels.net/2007/01/24/regular-expressions-for-nsstring/

*/
- (BOOL)isUUID
{
NSString *regex = @"^(([0-9a-fA-F]){8}-([0-9a-fA-F]){4}-([0-9a-fA- F]){4}-([0-9a-fA-F]){4}-([0-9a-fA-F]){12})$";
        
        // supported non standard regex format is at 
http://www.icu-project.org/userguide/regexp.html
NSPredicate *regextest = [NSPredicate predicateWithFormat:@"SELF MATCHES %@", regex];
        return [regextest evaluateWithObject:self];
}

Jonathan Mitchell

_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to