Bas Dijkstra
05/09/2024, 3:06 PM{
"matchesJsonPath": "$[?($.newPassword =~ /(?=.+?[A-Z])(?=.+?[a-z])(?=.+?[0-9])(?=.+?[#?!@$%^&*-]).{8,}/i)]"
}
However, this seems to also match test123!
, i.e., it doesn't discern between upper- and lowercase characters. All other criteria are checked correctly.
I don't think there's anything wrong with the regex itself, or at least when I test it with https://regexr.com/, it does not accept test123!
..
Any ideas?Tom
05/09/2024, 3:21 PMand
matchers as the sub-clause to matchesJsonPath
?Bas Dijkstra
05/09/2024, 3:24 PMTom
05/09/2024, 3:26 PMBas Dijkstra
05/09/2024, 3:28 PMBas Dijkstra
05/09/2024, 3:33 PMTom
05/09/2024, 3:42 PM.*{8,}
as one of the matchers?Bas Dijkstra
05/09/2024, 3:43 PMSamuel Adesoga
05/10/2024, 9:19 AMBas Dijkstra
05/11/2024, 6:41 AM"bodyPatterns" : [ {
"matchesJsonPath" : "$[?($.oldPassword == 'abcDEF123@')]"
},
{
"matchesJsonPath" : {
"expression": "$.newPassword",
"and" : [
{
"matches": "[A-Z]+"
},
{
"matches": "[a-z]+"
},
{
"matches": "[0-9]+"
},
{
"matches": "[#?!@$%^&*-]+"
},
{
"matches": ".*{8,}"
}
]
}
}
And now it doesn't match anything anymore.. Not even the passwords that were deemed OK before.