It states zero or maybe more occurrence of whitespace figures, followed by a comma after which followed by zero or more incidence of whitespace figures.Having said that x.replaceAll("s+", ""); will be far more successful strategy for trimming Areas (if string may have several contiguous spaces) simply because of potentially less no of replacements