I am boggled by regex I think I\'m dyslexic when it comes to these horrible bits of code.. anyway, there must be an easier way to do this- (ie. list a set of replace instanc
You can just chain them all in order.
function clean(string) {
return string.replace(/\@~rb~@/g, '').replace(/}/g, '@~rb~@')
.replace(/\@~lb~@/g, '').replace(/{/g, '@~lb~@')
.replace(/\@~qu~@/g, '').replace(/\"/g, '@~qu~@')
.replace(/\@~cn~@/g, '').replace(/\:/g, '@~cn~@')
.replace(/\@-cm-@/g, '').replace(/\,/g, '@-cm-@');
}