Just as a clarification, I'm looking for a regex expression, not for
myStr.replaceAll("\\(.*\\)", "");
- cannot use that there.
> Hi,
> How do I get rid of any text in parentheses?
[quoted text clipped - 15 lines]
>
> Thanks!
hiwa - 25 Feb 2007 01:08 GMT
> Just as a clarification, I'm looking for a regex expression, not for
> myStr.replaceAll("\\(.*\\)", "");
[quoted text clipped - 20 lines]
>
> > Thanks!
You should use replaceAll() method with reluctant quantifiers.
> "(.*)((?:\\(.*\\)*))(.*)"
What were you trying to do with this thing?
Getting rid of parenthesized parts?
Then, replaceAll() is your best friend.