title: Objective-C, regular expression match repetition
body: <p>I found a problem in regular expression to match all group repetition.</p>
  
  <p>This is a simple example:</p>
  
  <pre><code>NSString *string = @"A1BA2BA3BC";
  NSString *pattern = @"(A[^AB]+B)+C";
  
  NSError *error = nil;
  NSRegularExpression *regex = [NSRegularExpression regularExpressionWithPattern:pattern options:0 error:&amp;error];
  NSArray *array = [regex matchesInString:string options:0 range:NSMakeRange(0, [string length])];
  </code></pre>
  
  <p>Returning <code>array</code> have one element which contains two ranges, whole input string and last captured group <code>"A3B"</code>. First two groups, <code>"A1B"</code> and <code>"A2B"</code>, are not captured as I expected.</p>
  
  <p>I've tried all from greedy to lazy matching.</p>