Can Someone Help Me Understand This Algorithm

I did a Challenge of the day at CodeFights.com that consisted of taking lets say a string s = "zz000!!G" and shortening it to = "z0!G" so you are supposed to just combined all like characters that are together. I managed to complete this program with my own algorithm but when i went to see some other peoples sumbisions there were about 30 entries that had this exact algorithm http://pastebin.com/wBYeAwZD
Can someone explain how this works??

This is called Regular Expression

s.replaceAll("(.)`+","$1");

. matches everything
1+ match everything that occures 1 times or more
$1 just takes the group (.) match

should be about right