i want to match a url inside anchor html and return the url. the sub-domain and path file always change.
this's the url.
https://regex101.com/r/gB4bB8/3
i want it to return the url only https://s04.solidfilesusercontent.com/NGU0MGIwZTg1MDU0MjI5YzE3YzM3NDQ4ZWJhNjVhN2Y3ZGVmN2EwNDoxYkFmRkY6ODZvb29qRG8tdFluMXl2TU1hR1dBN19ockt3/v8grz2RpkMkWd/As_The_Gods_Will_%282014%29-1.mp4
this's my code so far
$matches = "";
$regex = '/<a.+?href=("|\')(.+?)\1/i';
$url = "<a target='blank' href='https://s04.solidfilesusercontent.com/NGU0MGIwZTg1MDU0MjI5YzE3YzM3NDQ4ZWJhNjVhN2Y3ZGVmN2EwNDoxYkFmRkY6ODZvb29qRG8tdFluMXl2TU1hR1dBN19ockt3/v8grz2RpkMkWd/As_The_Gods_Will_%282014%29-1.mp4'>https://s04.solidfilesusercontent.com/NGU0MGIwZTg1MDU0MjI5YzE3YzM3NDQ4ZWJhNjVhN2Y3ZGVmN2EwNDoxYkFmRkY6ODZvb29qRG8tdFluMXl2TU1hR1dBN19ockt3/v8grz2RpkMkWd/As_The_Gods_Will_%282014%29-1.mp4</a>";
preg_match($regex, $url, $matches);
echo $matches[0];
thx