我找不到任何PHP Regex清除此字符串:
“[21m [0; 34; 1m [21m [HoaxPvP] [m [21m [0; 32; 1mhi [m] 至: “[HoaxPvP] hi”
如果你找到了正则表达式,请提前感谢。
答案 0 :(得分:1)
preg_replace('/\[[\d;]*m/', '', '[21m[0;34;1m[21m[HoaxPvP][m [21m[0;32;1mhi[m');
答案 1 :(得分:1)
$subject = preg_replace('/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/', "",$subject);
$subject = preg_replace('/[\x03|\x1a]/', "", $subject);