I am new to regex in PHP and understand the basic patterns however the ones below are a bit complex and I don't understand what the following pattern matches:
$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#... "<a href='' rel='nofollow'></a>", $ret);
$ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*... "<a href='http://' rel='nofollow'></a>", $ret);
Could someone please explain them?
Thanks.