How can I define repetitive groups in Java Regex?
Lets say a 2digit number [0-9]{2} multiple times separates by ,
12,34,98,11
Is that p
In Java you may also use Scanner APIs for this:
Scanner
final Pattern pat = Pattern.compile("\\d{2}"); Scanner scan = new Scanner("12,34,98,11"); scan.useDelimiter(","); while(scan.hasNext(pat)) { System.out.println( "Token: " + scan.next() ); } scan.close();