| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 | 1 1 30 1 | define(function(){
/**
* Remove non-word chars.
* @example removeNonWord('lorem! ipsum?') -> 'lorem ipsum'
* @param {string} str
* @return {string}
* @version 0.1.0 (2011/07/20)
*/
function removeNonWord(str){
return (str || '').replace(/[^0-9a-zA-Z\xC0-\xFF \-]/g, ''); //remove non-word chars
}
return removeNonWord;
});
|