Q:

Java: removing part of the string starting from "(" and ending with ")"

Given the string "Hello World (27348)".
How would you convert this too "Hello World" by specifically removing part of the string starting from "(" and ending with ")" with regex? 
string.replaceAll("???", "");

A:

I don't know why it needs to be done with regex:
string.substring(0, string.indexOf("("));

If you must use regex:
string.replaceAll("\\(.*?\\)", "")

The latter is different in that it removes everything between (and including) the paren whereas the former removes everything after ( even if there are characters after ).

