Regular Expressions 101

Community Patterns

VK Video url check and get ID

1

Regular Expression
PCRE (PHP <7.3)

@
^(?:(?:http(?:s?)://)?(?:www\.)?vk\.com/video)(?:\?z=video)?(-?\d{5,}_\d{5,})
@

Description

$match[0] - full url $match[1] - just id

Submitted by Denis Efremov - 8 years ago