I would like to have the regex to validate that user has entered any user name but not administrator. So that anything other than “administrator” is just fine.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
A simple string compare will do this job.
But if you want a regex You can use negative look-ahead assertion as:
Rubular Link
You may want to replace
.*with the regex to match a valid username based on allowed character and/or length requirements.