正则替换全角字符
程序员文章站
2022-05-05 08:02:18
...
php代码
function zo_replace(text) { return text && text.replace(/[\u3000\uff01-\uff5f]/g, function($0) { return $0 == "\u3000" ? " " : String.fromCharCode($0.charCodeAt(0) - 0xfee0); }); }