title: Regex match digits before 2 characters, using OR google sheets
body: <p>I'm using <code>REGEXEXTRACT</code> in Google Sheets which uses the RE2 RegEx.</p>
  
  <p>I want to get digits in a string that occur either before the character <code>P</code> or before the characters <code>MC</code>.</p>
  
  <p>here is what i have so far: <code>(\.?\d*).?MC</code> this works if my text is something like "<code>FM.3 MC1</code>". In Google Sheets it is like this:</p>
  
  <pre><code>=REGEXEXTRACT(A1,"(\.?\d*).?MC") 
  </code></pre>
  
  <p>This works for getting digits before <code>MC</code>, I want to add OR <code>P</code> like this:</p>
  
  <pre><code>(\.?\d*).?MC|P 
  </code></pre>
  
  <p>This returns <code>.3</code> if my text is "<code>FM.3 MC1</code>", but is blank if my text is "<code>FM.3 MC1 P2</code>" or "<code>FM.3 P1</code>" and returns <code>#N/A</code> if my text is "<code>FM.3</code>".</p>
  
  <p>Also if my regex is <code>(\.?\d*).?P|MC</code> , then it returns <code>.3</code> if my text is "<code>FM.3 P1</code>" is blank if my text is "<code>FM.3 MC P1</code>"</p>
  
  <p>I'm not sure if this is RegEx, or if Google Sheets are being weird.</p>
  
  <p>I'm looking for tips.</p>