Skip to content
Advertisement

password validation regex java

JavaScript

i have used regex for password validation. i am using servlet for this validation but there is some issue arising. this method isnt working. it returns all the errors even if some conditions are satisfied. help! if anything else reqd i will add it just ask.

input –

JavaScript

expected output –

JavaScript

actual output –

JavaScript

Advertisement

Answer

Your pattern are incomplete. Add .+ at the end of each pattern.

Example: change

JavaScript

to

JavaScript
User contributions licensed under: CC BY-SA
2 People found this is helpful
Advertisement