Hi Greg,
If I understand you right, you want at least one of each of the digit group, alpha group and special characters in any order.
After playing about a bit, I came up with...
Code:
^([0-9]+(([a-zA-Z]+[0-9]*[£])|([£]+[0-9]*[a-zA-Z]))|[a-zA-Z]+(([0-9]+[a-zA-Z]*[£])|([£]+[a-zA-Z]*[0-9]))|[£]+(([0-9]+[£]*[a-zA-Z])|([a-zA-Z]+[£]*[0-9])))[0-9a-zA-Z£]*$
which I think does what you're after (I used £ as a special character), not much fun to construct though, so I created the pattern using this...
Code:
function GetExp(specialChars){
var digits = "0-9";
var alphas = "a-zA-Z";
var temp = "^(";
temp += GetExpPart(digits, alphas, specialChars) + "|";
temp += GetExpPart(alphas, digits, specialChars) + "|";
temp += GetExpPart(specialChars, digits, alphas);
temp += ")[" + digits + alphas + specialChars + "]*$"
return temp;
}
function GetExpPart(pFirstGroup, pOtherGroup1, pOtherGroup2){
return "[" + pFirstGroup + "]+(([" + pOtherGroup1 + "]+[" + pFirstGroup + "]*[" + pOtherGroup2 + "])" +
"|([" + pOtherGroup2 + "]+[" + pFirstGroup + "]*[" + pOtherGroup1 + "]))";
}
HTH,
Chris