0
I need to remove everything around the link below. I’m using preg_match with regular expression, and as I’m new in the area, I’m having a hard time finding my mistake. Would you please help me?
Like I’m doing:
preg_match('/www.facebook.com/plugins/video.php?href=\/(.+)&show_text=0&width=560', $v, $output
Accurate: "https%3A%2F%2Fwww.facebook.com%2Fportatest%2Fvideos%2F1585186298555265%2F"
Thank you
You can try to get what is in the group of this regex:
href=(.+)(?=&show_text)
, in which here is the demo. As I have no experience in php, I don’t know the programming. But this regex captures the group that is betweenhref=
and&show_text
– danieltakeshi