正则表达式去除所有标签html标签

tempStr = tempStr.replace(/(<([^>]+)>)/ig,"").replace(/[\r\n]/g,""); //去除所有html标签<></>.去除所有换行符。
tempStr = tempStr.replace(/\s+/g,'#'); //所有的空格替换成 #