Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Substring error with ( or )

807606Feb 24 2007 — edited Feb 24 2007
Hi, i'm trying to do a substring in a string.. using:
txt.replaceAll(":(", "SAD");
but get an error
"Exception in thread "AWT-EventQueue-0" java.util.regex.PatternSyntaxException: Unclosed group near index 2
:("
or when i use:
txt.replaceAll(":(", "HAPPY");
I get the error:
"Unmatched closing ')' near index 0 :)"
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 24 2007
Added on Feb 24 2007
12 comments
392 views