still struggling with regex 🙂
i have this code:
$link = '/\bhttp:\/\/.+\..+[\/\w]?\b/i';
$match = array();
if (preg_match($link, 'http://bit.ly/hghjK6 bla bla',&$match))
{
echo 'match'.'</br>';
print_r($match);
}
as i’m trying to extract only the URL from the string i cant isolate it and the value inserted into $match always contain the “bla bla” taht follows the URL in my string
what is the regex needed to only match the URL and nothing else that comes after?
Thanks
this matches ALL the URL in a text.