3v4l.org

run code in 300+ PHP versions simultaneously
<?php $string = preg_quote("\دد"); echo preg_replace('#(?:^[^\pL]*)|(?:[^\pL]*$)#u','',$string);

preferences:
20.71 ms | 405 KiB | 5 Q