title: Is it possible to generate strings that match a regular expression string?
body: <p>Is it possible to display the strings that match a regular expression?</p>
  
  <p>Example: </p>
  
  <p>Take the expression <code>/^AD\d{3}/</code>
  and display <code>AD999</code></p>
  
  <p>What I'm doing is validating a string that is pretty simple either containing all numbers, a few characters maybe, and maybe a '-'. I am validating a postal code on form submit against a database of all countries that use a postal code.</p>
  
  <p>I could perform it in Javascript or PHP, if that makes any difference.</p>