Good morning, I have 2 regular expressions, where one serves to get the URL of any href
, and another that I need to sort out that would only be to get the URL's that are not within href
, that is, only the URL's entered with www
, https://
and http://
start. With the second expression I can not get the urls that are inside the href.
1st expression to get href
preg_replace('/href="(?!http:\/\/)([^"]+)"/e', '$this->href("$1", "$id", "$posi_email")', $texto);
2nd expression that should not get the urls inside a href.
preg_replace('/(www.|http:\/\/|https:\/\/)[^ ]+?([^,])+)/e', '$this->url("$1", "$id", "$posi_email")', $texto);