Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java using regular expressions

Tags:

java

regex

I am working with resetting passwords. I need a way in java using regular expressions to reset the password so it cannot contain 4 consecutive characters from the previous password.

like image 224
Perry Avatar asked Jan 21 '23 15:01

Perry


1 Answers

I don't think that regular expression is an apropriate tool for this task.

Actually, I can't see any other solution then a loop which will try to find a substring of 4 common characters.

like image 173
Roman Avatar answered Jan 28 '23 18:01

Roman