CopyPastor

Detecting plagiarism made easy.

Score: 0.8635266721248627; Reported for: String similarity Open both answers

Possible Plagiarism

Reposted on 2024-03-28
by James

Original Post

Original - Posted on 2024-03-28
by James



            
Present in both answers; Present only in the new answer; Present only in the old answer;

This will do the trick. Look ahead is nice for this...
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d.*\d)(?=.*\W.*\W)[a-zA-Z0-9\S]{4,}$/
**EXPLAINED in pieces below**
Look ahead/require for a lower case:
(?=.*[a-z])
Look ahead/require an uppercase:
(?=.*[A-Z])
Look ahead/require 2 digits:
(?=.*\d.*\d)

Look ahead/require any 2 non-word chars (same as [^a-zA_Z0-9_]):
(?=.*\W.*\W)
Entire password must contain a minimum of 4, a maximum is not defined, and only alpha numeric and special chars (non white-space):
[\S]{4,}
This will do the trick. Look ahead is nice for this...
/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*\S)(?=.*[\S])[\S]{4,20}$/
**EXPLAINED in pieces below**
Look ahead/require for a lower case:
(?=.*[a-z])
Look ahead/require an uppercase:
(?=.*[A-Z])
Look ahead/require a digit:
(?=.*\d)

Look ahead/require any chars except white-space:
(?=.*[\S])
Entire password must contain a minimum of 4 and maximum of 20 only alpha numeric and special chars (non white-space):
[\S]{4,20}

        
Present in both answers; Present only in the new answer; Present only in the old answer;