I got some link like:
/3/topic/video1148288/
and I want to take the number after video. I can't replace the link with only numbers because there are more before the actual video's id.
I tried
$embed = preg_match("#\b/video([0-9][0-9][0-9][0-9][0-9][0-9][0-9])/#", $raw);
But it doesn't work.
Any help?
doesn't work. It works and here's a demo. However I would replace all those numbers with[0-9]+which means match a digit one or more times. If you are certain that there will always be 7 numbers, then you could use[0-9]{7}.