title: Swift 3 - How do I extract captured groups in regular expressions?
body: <p>I am using Swift 3 and trying to access captured groups.    </p>
  
  <pre><code>let regexp = "((ALREADY PAID | NOT ALR | PROVIDER MAY | READY | MAY BILL | BILL YOU | PAID)((.|\\n)*))(( \\d+)(\\.+|-+)(\\d\\d))"
  
  // check if some substring is in the recognized text
  if let range = stringText.range(of:regexp, options: .regularExpression) {
      let result = tesseract.recognizedText.substring(with:range)
  }
  </code></pre>
  
  <p>I want to be able to extract out the last two numbers captured (<code>\d\d</code>) so if the text was: <code>ALREADY PAID asfasdfadsfasdf 39.15</code>, it would extract <code>15</code>.  Here is a regex builder that shows what I want.  Normally, I would be able to do <code>$8</code> to get the 8th group that was extracted but I don't know how to do that in Swift 3.</p>
  
  <p><a href="http://regexr.com/3fh1e" rel="noreferrer">http://regexr.com/3fh1e</a></p>