title: Dealing with shorthand characters in regular expressions
body: <p>I have to built a NFA from a regular expression and then go through a text and found matching patterns. </p>
  
  <p>I used Thompson's construction to build the NFA when the expression contains only the alphabet characters, <code>*</code>, <code>|</code> and <code>.</code> (Cleene star, union and concatenation respectively).</p>
  
  <p>But how to deal with shorthand characters in the regular expression such as <code>\d</code> can be random digit from <code>0</code> to <code>9</code> and <code>\a</code> - random letter? </p>
  
  <p>I sure can just replace it in the regular expression as <code>(0|1|2|3|4|5|6|7|8|9)</code> but I highly doubt that is what I am supposed to do.</p>