I\'ve used the following regex to try to remove parentheses and everything within them in a string called name.
name
name.replaceAll(\"\\\\(.*\\\\)\"
Strings are immutable. You have to do this:
name = name.replaceAll("\\(.*\\)", "");
Edit: Also, since the .* is greedy, it will kill as much as it can. So "(abc)something(def)" will be turned into "".
.*
"(abc)something(def)"
""