title: Regular expression for specific combination of alphabets and numbers
body: <p>I am trying to create regular expression for following type of strings:</p>
  
  <blockquote>
    <p>combination of the prefix (XI/ YV/ XD/ YQ/ XZ), numerical digits only, and either no ‘Z’ or a ‘Z’ suffix.</p>
  </blockquote>
  
  <p>For example, <code>XD35Z</code> should pass but <code>XD01HW</code> should not pass.</p>
  
  <p>So far I tried following:</p>
  
  <ul>
  <li><p><code>@"XD\d+Z?"</code> - <code>XD35Z</code> passes but unfortunately it also works for <code>XD01HW</code> </p></li>
  <li><p><code>@"XD\d+$Z"</code> - <code>XD01HW</code> fails which is what I want but <code>XD35Z</code> also fails</p></li>
  <li><p>I have also tried <code>@"XD\d{1,}Z"?</code> but it did not work</p></li>
  </ul>
  
  <p>I need a single regex which will give me appropriate results for both types of strings.</p>