Skip to Main Content

New to Java

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!

replaceAll regular expression

807601Apr 2 2008 — edited Apr 2 2008
I have a problem with replaceAll, and I would like to know if it is eventually something wrong in java

I try to replace the String "\E" with "\\U" and out comes U with only one slash

if( ("a\\Ea".replaceAll("\\\\E", "\\"+"\\U")).equals("a\\Ua") == true){
System.out.print("error");
}

Thanks Thomas
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 30 2008
Added on Apr 2 2008
2 comments
76 views