Regular Expressions 101

Community Patterns

VK owner id and item id regex

0

Regular Expression
PCRE2 (PHP >=7.3)

/
((?<=\/|=)wall|photo|video)(-?[0-9]*)_([0-9]*)(\?reply=)?((?<=reply=)[0-9]*)?
/
g

Description

This regex allows access to owner id and item id of VK url.

Submitted by MagicWinnie - a year ago