1 2 3 4 5 6 7 8 9
| public static final String MY_REG_EX = "\"666\",\"[a-zA-Z0-9]{1,8}\",\"[0-9]{5}\",\"[CDEFRT]\",\".{0,12}\",\"-{0,1}(\\d{1,16})\\.(\\d{0,2})\",\"-{0,1}(\\d{1,16})\\.(\\d{0,2})\",\"-{0,1}(\\d{1,16})\\.(\\d{0,2})\"";
public static void main (String[] args){
Pattern myPattern = Pattern.compile(MY_REG_EX);
String myCSVEntry = String myCSVEntry = "\"666\",\"TOTO4321\",\"12345\",\"C\",\"JEAN-MARC1\",\"100000000\",\"123456789.12\",\"-12345678.91\"";
// Devrait retourner true mais ce n'est pas le cas
System.out.println("Result : " + myPattern.matcher(myCSVEntry).matches());
} |
Partager