It claims zero or more event of whitespace figures, followed by a comma and after that followed by zero or more occurrence of whitespace people.On the other hand x.replaceAll("s+", ""); will be much more productive means of trimming spaces (if string can have multiple contiguous Areas) because of probably less no of replacements thanks the to prove