title: Generate a random string based on a regular expression
body: <p>Is there any way of generating random text which satisfies provided regular expression.<br>
  I am looking for a function which works like below  </p>
  
  <pre><code>var reg = Some Regular Expression  
  var str = RandString(reg)
  </code></pre>