3v4l.org

run code in 300+ PHP versions simultaneously
<?php $search = "/[^<>agt](.*)[^g<a\/t>]/"; $replace = "your new inner text"; $string = "thanks <tag>i dont know what is here</tag>"; echo preg_replace($search,$replace,$string);

preferences:
55.28 ms | 402 KiB | 5 Q