title: What is the equivalent of ? in MatchesMask of delphi in regular expression?
body: <p>Delphi's <a href="http://docwiki.embarcadero.com/Libraries/XE7/en/System.Masks.MatchesMask" rel="nofollow noreferrer">MatchesMask</a> documentation says this about <code>?</code> (emphasis mine):</p>
  
  <blockquote>
    <p>Wildcards are asterisks (*) or question marks (?). An asterisk matches any number of characters. <strong>A question mark matches a single arbitrary character.</strong></p>
  </blockquote>
  
  <p>My question: is <code>?</code> in <code>MatchesMask</code> equivalent to <code>.</code> in regex? Or is it equivalent to <code>.?</code> in regex? As far as I can tell, there is a difference between the two. <code>.</code> matches exactly <em>one</em> non-newline character, whereas <code>.?</code> matches <em>zero or one</em> non-newline character.</p>
  
  <p>I have read <a href="https://stackoverflow.com/questions/11828908/what-is-the-c-sharp-equivalent-of-the-delphi-matchesmask-function">this</a> but it didn't help much, apart from telling me to use regex for <code>MatchesMask</code>.</p>
  
  <hr>
  
  <p>In case it helps, what I actually want to do is convert some delphi code into C#, where I came across this code, where <code>myMask</code> is a string ending with a few <code>?</code>:</p>
  
  <pre class="lang-pascal prettyprint-override"><code>if MatchesMask(myString, myMask) then begin  // myMask has value '100-10???'
    Result := True;
    exit;
  end;
  </code></pre>