Diya
Diya

Reputation: 1

Should not allow allows continuous use of special characters in email validation

User is not allow to enter special character as the first character of email address, Also not allows continuous use of special characters eg: !aman%^&*?'}{[email protected]

Upvotes: 0

Views: 232

Answers (1)

Tim Biegeleisen
Tim Biegeleisen

Reputation: 522787

An exact implementation of your requirements might be:

^(?!.*[^A-Za-z0-9]{2})[A-Za-z0-9].*$

This would forbid the password starting with a non alphanumeric character, and would also not allow two non alphanumeric symbols from occurring in succession.

Upvotes: 2

Related Questions