@"^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{6,}$"
I am using this regular expression for password validation which gives one upper case, one lowercase and a number. But what I want is a special character in it but it should optional but above mentioned must be mandatory.