title: Is there a regular expression for MMSI(Maritime Mobile Service Identity)
body: <p>Is there a regular expression for MMSI (<a href="https://en.wikipedia.org/wiki/Maritime_Mobile_Service_Identity" rel="nofollow">Maritime Mobile Service Identity</a>)?</p>
  
  <blockquote>
    <p>MIDxxxxxx<br>
    MIDxxx000<br>
    0MIDxxxxx<br>
    00MIDxxxx</p>
  </blockquote>
  
  <p>Where x is a digit</p>
  
  <p>I tried the following regex:</p>
  
  <pre><code>^(0*MID(\d{4,6}))$
  </code></pre>
  
  <p>but it also accepts longer than 9 digits,
  how can I limit the total phrase length?</p>