NSString *testStr = [NSString stringWithString:@""]; NSArray *matches = [testStr findRegularExpression:@"version=\"([^\"]+)+.*encoding=\"([^\"]+)+" ignoreCase:YES]; NSLog(@"matches: %@", matches);