3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = 'hi test1="12c4 ab3d" blablabla test1="abcd 3456 sdfs 2435"'; echo preg_replace('~\btest1="[^"\s]*\K[^"]+~', '', $str);

preferences:
29.23 ms | 404 KiB | 5 Q