title: Canadian postal code regex?
body: <p>In the postal code field only the following format should be valid. </p>
  
  <p>B1C 2B3 or B1C3D3 </p>
  
  <p>how to write a regex for this? </p>
  
  <p>Edited: </p>
  
  <pre><code>^([a-zA-Z]\d[a-zA-z]( )?\d[a-zA-Z]\d)$
  </code></pre>
  
  <p>This is my regex but it only accepting B1C C1B (notice space in between )  format. even with out space should be valid</p>