Regular Expressions 101

Community Patterns

Facebook Video ID from link

1

Regular Expression
PCRE (PHP <7.3)

/
facebook\.com\/(?:photo.php\?v=|video\/embed\?video_id=|v\/?)(\d+)
/
gi

Description

Matches the video id in FB links

Submitted by Eirenaios - 10 years ago