It says zero or maybe more occurrence of whitespace characters, followed by a comma after which followed by zero or more event of whitespace characters.However x.replaceAll("s+", ""); will likely be far more productive strategy for trimming spaces (if string can have several contiguous spaces) simply because of potentially much less no of replaceme