Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我找不到任何清除此字符串的 PHP 正则表达式:
“[21m[0;34;1m[21m[HoaxPvP][m [21m[0;32;1mhi[m”到:“[HoaxPvP] hi”
如果您为此找到正则表达式,请提前感谢。
preg_replace('/\[[\d;]*m/', '', '[21m[0;34;1m[21m[HoaxPvP][m [21m[0;32;1mhi[m');
$subject = preg_replace('/\x1b(\[|\(|\))[;?0-9]*[0-9A-Za-z]/', "",$subject); $subject = preg_replace('/[\x03|\x1a]/', "", $subject);