RegExp Test
JavaScript
var text = " ";
var numChars = "0123456789";
var upCaseChars="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
var lowCaseChars="abcdefghijklmnopqrstuvwxyz";
for( var i=0; i < 4; i++ )
{
text += numChars.charAt(Math.floor(Math.random() * numChars.length));
text += upCaseChars.charAt(Math.floor(Math.random() * upCaseChars.length));
text += lowCaseChars.charAt(Math.floor(Math.random() * lowCaseChars.length));
}
alert (text);