Hey guys,

Am I missing something here? My trim() function seems to halt JavaScript execution in Chrome. Why is this?

Code:
function trim(s) {
			s = s.replace(/(^\s*)|(\s*$)/gi,"");
			s = s.replace(/[ ]{2,}/gi," ");
			s = s.replace(/\n /,"\n");
			return s;
		}

It works in IE and firefox.. wait no it doesn't. not anymore. wtf.