3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text = "http://www.google.com/\r\nhttp://www.google.com/\r\nhttp://www.google.com/"; $matches[0] = preg_replace('/(http|ftp)+(s)?:(\/\/)((\w|\.|\-)+)(\/)?(\S)+/i', '[url]\0[\4]',$text); print_r($matches[0]);

preferences:
33.27 ms | 402 KiB | 5 Q