I have this kind of regex on PHP :
$str="first word https://www.helloz.it last word";
$str=preg_replace(
'#[^"](((http|https|ftp)://)[^\s
]+)#',
'<a class="lforum" href="$1">$1</a>',
$str);
echo nl2br($str);
And the output that I'll expect is :
first word <a class="lforum" href="https://www.helloz.it">https://www.helloz.it</a> last word
but in fact the output is :
first word<a class="lforum" href="https://www.helloz.it">https://www.helloz.it</a> last word
(notice the missing whitespace between first word
and <a class...
Where is it vanished that whitespace? :) Thanks