2
Good morning, I have 2 regular expressions, where one serves to get the URL of any href
, and another that I need to arrange that would just be to get the URL’s that are not inside a href
, ie, only the URL’s typed with start www
, https://
and http://
. With the second expression I can’t get the urls inside the href.
1°Expression to catch the href
preg_replace('/href="(?!http:\/\/)([^"]+)"/e', '$this->href("$1", "$id", "$posi_email")', $texto);
2°Expression that should not pick up the urls inside a href.
preg_replace('/(www.|http:\/\/|https:\/\/)[^ ]+?([^,])+)/e', '$this->url("$1", "$id", "$posi_email")', $texto);
I was in doubt in your second expression with what you need to match the text. It would be any page link?
– Adir Kuhn
Be very careful with that
preg_replace
modifiere
. Has already been depreciated!– Wallace Maxters