praveen kumar praveen kumar - 1 year ago 97
Objective-C Question

Password Validation Regular Expression - how to include special character?


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.

Answer Source

This will allow these special characters: - (hyphen), * (asterisk) and _ (underscore).


If you want to add your own special characters, add them into this part of the regex [-*_0-9a-zA-Z] (inside the square bracket)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download