Pattern pt = Pattern.compile("([0-1\\s]){1,}([+-/*//^]){1}([\\s0-1]{1,})");
if (scan.findInLine(pt) != null) {
if (scan.match().group(1) != null) {
System.out.println("g1= "+(scan.match().group(1)));
System.out.println("g2= "+(scan.match().group(2)));
System.out.println("g3= "+(scan.match().group(3)));
}
}
input
11001-100011
output
g1= 1
g2= -
g3= 100011
g1 = должна быть 11001 но нет что не правильно?