I\'m trying to extract a string from round brackets. Let\'s say, I have John Doe (123456789) and I want to output the string 123456789 only.
John Doe (123456789)
123456789
String str="John Doe (123456789)"; System.out.println(str.substring(str.indexOf("(")+1,str.indexOf(")")));
Here I'm performing string operations. I'm not that much familiar with regex.