Regular Expressions 101

Community Patterns

Youtube ID Extractor

1

Regular Expression
PCRE (PHP <7.3)

~
^(https?://)?(www\.)?youtu(\.be|be\.com)/(watch\?v=|embed/)?(?<id>[\w-]{11,})
~
gm

Description

no description available

Submitted by anonymous - 7 years ago