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
You could do something like:
String str = "(1,2) (3,4)"; Matcher m = Pattern.compile("\\((\\d+),(\\d+)\\) \\((\\d+),(\\d+)\\)").matcher(str); if (m.matches()) { System.out.println(m.group(1)); // number 1 ... }