I'm looking for a regex for my JavaScript password function which checks that the user's password is at least 8 characters long with at least 1 number in it.
Thank you!
I'm looking for a regex for my JavaScript password function which checks that the user's password is at least 8 characters long with at least 1 number in it.
Thank you!
/^(?=.*\d).{8,}$/
(?=.*\d)
Asserts that a digit is anywhere within the string.
.{8,}
Asserts that the entire string is a composition of at least 8 "anything, except new line".