Is there any way of generating random text which satisfies provided regular expression. I am looking for a function which works like below
var reg = So
Your question is pretty open so hopefully this steers you to the right solution. Get the current time (in seconds), MD5 it, check it against a REGEX, return the match.
Running Example: http://jsfiddle.net/MattLo/3gKrb/
Usage: RandString(/([A-Za-z])/ig); // expected to be a string
RandString(/([A-Za-z])/ig); // expected to be a string