3v4l.org

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

preferences:
53.95 ms | 405 KiB | 5 Q