Reputation: 1670
I want to get rid of HTML tags and nbsp; How can I combine these operations?
JS
.replace(/ /g,'').replace(/(<([^>]+)>)/ig,"")
Upvotes: 0
Views: 1929
Reputation: 318342
Just join them together
.replace(/( |(<([^>]+)>))/ig,'');
Upvotes: 6