Bonjour la team,

J'ai un test sur une expression régulière qui marchent en base mais pas dans mon code Java.

Voici mon code:

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
 boolean t1 = "66166".matches("^(..[1-9]|V)");
 boolean t2 = "66166".matches("^(..[2-9]|V)");
 
 boolean t3 = Pattern.matches("^(..[1-9]|V)", "66166");
 boolean t4 = Pattern.matches("^(..[2-9]|V)", "66166");
Savez-vous pourquoi mes booléens t1 et t3 sont faux ?

Merci de votre aide,
Berni.