If I gave you a string as such:
If you look closely in the text there are commas in places like:
>, ., here, try The first two are common and need to be removed, the last one is normal and should stay in. Most people would suggest:
replace(/,/g, '') How ever the issue is that will remove all commas. Right now its safe to assume that any comma after a closing bracket or a period can be removed. How ever any other comma should stay in.
Any help on this would be appreciated I don't know if regex is appropriate or if there is a underscore way of doing this or what.

.replace(/\B,\B/g, '')can be used.