If you just need to remove whitespace from the beginning and end, you can use string.trim()
If you want to make sure that the only place your string has spaces is a single space after each comma, then yours works fine.
There are other things you might want to do that could be done with different regular expressions (with or without also using trim(). For instance, you might want to make sure that there is never more than one space in a row, or that there is always a space after a period (full stop), etc.
Like I said, it depends on your goal. If all you were trying to do is remove the whitespace at the beginning and end, then no. It would be considered better to just use trim().