Hi, I am writing a program to check if the password entered is bad,strong or excellent. If a password is excellent, the password needs to include letter in capital(atleast one), atleast one digit and atleast one specail character(@,$ etc.) I am able to validate everything except special characters. Please help.Couldnt find the answer,though its such a simple thing

Re: [Shrutika] How to validate special character passwords?
[In reply to]

Can't Post

Character classes also have ordinary and special characters, but the sets of ordinary and special characters inside a character class are different than those outside a character class. The special characters for a character class are -]\^$ and are matched using an escape: /[\]c]def/; # matches ']def' or 'cdef' $x = 'bcr'; /[$x]at/; # matches 'bat, 'cat', or 'rat' /[\$x]at/; # matches '$at' or 'xat' /[\\$x]at/; # matches '\at', 'bat, 'cat', or 'rat'

Re: [Tejas] How to validate special character passwords?
[In reply to]

Can't Post

Perl has several abbreviations for common character classes. (These definitions are those that Perl uses in ASCII-safe mode with the /a modifier. Otherwise they could match many more non-ASCII Unicode characters as well. See Backslash sequences in perlrecharclass for details.) \d is a digit and represents [0-9] \s is a whitespace character and represents [\ \t\r\n\f] \w is a word character (alphanumeric or _) and represents [0-9a-zA-Z_] \D is a negated \d; it represents any character but a digit [^0-9] \S is a negated \s; it represents any non-whitespace character [^\s] \W is a negated \w; it represents any non-word character [^\w] The period '.' matches any character but "\n"