Regex to replace consecutive characters in a string in Java [duplicate]

Multi tool use
This question already has an answer here:
What is the meaning of this regex given in this expression?
s = s.replaceAll("(.)\1", "");
This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
Check this out: https://www.regular-expressions.info/backref.html
It appears from the title of your post and the information above that this will replace repeated characters with an empty String. The 1 in the regex looks for repeated characters and the first group in the regex (.) looks for any character.
Oc3SUhw0q,z46pK0,nqx,KA9RVLWEAqi,BQPys97JOGw,Nl5F33RjhlfLN8A Uh,mBF7 dKI,V8d,H