My problem is that I have an expression which evaluates a given user password, to verify it’s a well made one or not. My expression looks like that:
"((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})"
Well, my problem is that when I put this string directly using string.matches() method it works with the password, however if I put it in a map injected by Spring like that
<map>
<entry key="PASSWORD_FILTER_EXPRESSION" value="((?=.*\d)(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%]).{6,20})" />
</map>
And use it loading from here it doesn’t work. I have been debugging and apparently it’s using the same String in both places, where can the problem be?
Escape the slashes: