Q:

Wild card in xcode

I want to separate a string by component and put it in an array
like
tagArray=[MyString componentsSeparatedByString:@"[Result]"];

problem is the tag [Result] has some values inside it eg [Result 0-1] how can i use wild cards to separate component by Result tag irrespective of the varying values.
 Thanks

A:

If you are using ARC you should do it like this:
NSError * error = nil;
__unsafe_unretained NSMutableString * authorsaddresses = [NSMutableString stringWithString:@""];
NSRegularExpression * regex = [NSRegularExpression regularExpressionWithPattern:@"^SOMEREGEX" options:NSRegularExpressionAnchorsMatchLines error:&error];
[regex enumerateMatchesInString:response options:0 range:NSMakeRange(0, [response length]) 
                         usingBlock:^(NSTextCheckingResult * result, NSMatchingFlags flags, BOOL * stop) {
                             [authorsaddresses appendString:response];
                         }];

