I am taking input from a file in following format:
(int1,int2) (int3,int4)
Now I want to read int1, int2, int3 and int4 in my Java code. How ca
To build on your own method, you can use a much simpler regex:
String s = "(1,2) (3,4)"; Pattern p = Pattern.compile("\\d+"); Matcher m = p.matcher(s); while (m.find()) { System.out.println(m.group()); }