Actually share the regulars, with which you can pull through the preg_match () user id (digits before the sign ) and video id (digits AFTER the mark ). Link to the video can be of two types: http://vk.com/video-39542227_162571485
http://vk.com/video39542227_162571485.
This is what I managed to write so far:
$str = '/(vk\.com|m\.vk\.com|)\/(video)()/i'; $res = preg_match($str, 'http://vk.com/video6596116_168597909', $match);