I have a some strings which have the pattern
word(word-number, word-number)
I would like to use a regular expression to extract the 3 words and the 2 numbers.
I am currently using this
String pattern = "(.+?) (\\() (.+?)(-) (\\d+?) (,) (.+?) (-) (\\d+?) (\\))";
String a = string.replaceAll(pattern, "$1");
String b = string.replaceAll(pattern, "$3");
String c = string.replaceAll(pattern, "$5");
String d = string.replaceAll(pattern, "$7");
String e = string.replaceAll(pattern, "$9");
But no avail any help would be greatly appreciated.