Have you been through the
String class, particularly what they call the parameters to the replaceAll method, and what they are described as? Have you been through the links given in the method description, and I trust you are familiar with what they mean? If not, read
the Java Tutorials section.
And remember that | is a meta-character, but you might not have that problem if you use | in the right-hand parameter.
*****************************************************************************
I have tried it, and it is easier than I thought. As long as I have understood your request properly!