I need to split a string to extract the parentheses and data in a string array using a Regex and keep the parentheses as well.
Extract from
1-2-3(0)(1)
To
(0)
(1)
I constructed this Regex, but can't make it work.
String phrase= "123(0)(1)"
String[] results = Regex.Split(phrase,"\\r+(?:\\(.*\\))");