Removing every other character in a string using Java regex
The code at the above link clearly details how to remove every other character from a string, however, I do not understand how it works and would like to so I can use it in the future. The Oracle page for replaceAll does not mention this type of use. What is the function of the $1 and the periods and the parentheses (I get that the one in parentheses is the one that is kept, but why, etc.? Thanks! :)