How to write regex to validate username with javascript

Asked 3 months ago in Web Development by Austin May Answer

Hi all,

I have to validate the username in one of my projects with this format AAAAA_000000.


  • A = represents any character
  • 0 = represents any number.

How can I do this task with javascript?

1 Answer

Answered 3 months ago by Bruna Amaral

Try the following regular expression to validate your usernames.

Add Your Answer

Answer Preview

By clicking "Post your answer", you agree to the terms,conditions and privacy policy of Terms & Conditions & Privacy Policy