mardi 24 février 2015

Java regular expression matches unexpectedly



How come the following returns true?



Pattern.compile("(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.{8,12})").match("passworD12345678").find();


Shouldn't it fail on (?=.{8,12}) since its length is outside of the range?




Aucun commentaire:

Enregistrer un commentaire