title: Regular expression for stock symbol validation (like goog, qqq, ibm, c etc.)
body: <p>I am using the below expression for checking the stock symbol whether it is valid or not</p>
  
  <pre><code>$s_optionPattern = "/^[a-z0-9]{1,6}\s+(?:c|call|p|put)\s+[0-9\.]+\s+[0-9]{4}[0-9]{2}[0-9]{2}$/i";
  
  $s_symbol   =   "TQNT CALL 6 20120519";
  $s_symbol2  =   "BRK'B CALL 80 20120317";
  echo "&lt;br&gt;---&gt;".preg_match($s_optionPattern, $s_symbol);
  echo "&lt;br&gt;---&gt;".preg_match($s_optionPattern, $s_symbol2);
  </code></pre>
  
  <p>Here I am getting false (0) for second symbol and true for first symbol.</p>
  
  <p>Is it correct if i edit the regular expression in the following manner.</p>
  
  <pre><code>$s_optionPattern = "/^[a-z0-9']{1,6}\s+(?:c|call|p|put)\s+[0-9\.]+\s+[0-9]{4}[0-9]{2}[0-9]{2}$/i";
  </code></pre>
  
  <p>But I am not sure it is correct or not. Can any body help me to fix this issue ?</p>
  
  <p>Here some stock symbols have (dot,') characters also like BRK.B, BRK'B.</p>