REGEX for the validation of the password

advertisements
  • min 3 letters
  • max 15
  • characters A-Za-z0-9
  • special charaters @#$%^&+=

This is what I have:

Regex.IsMatch(Password.Text, @"^[A-Za-z0-9@#$%^&+=]{3,15}$ ")

It always returns false.

Please help.


Take out the space at the end of the regular expression string. Also: corrected probable typos.

Regex.IsMatch(Password.Text, @"^[A-Za-z0-9@#$%^&+=]{3,15}$")