Regular Expressions 101

Community Patterns

2

update match

PCRE (PHP <7.3)
no description available
Submitted by ozarzu - 8 years ago

Capture YouTube Video ID

1

Regular Expression
PCRE (PHP <7.3)

/
(?:youtube(?:-nocookie)?\.com\/(?:[^\/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})
/
ig

Description

Loading markdown...
Submitted by Kevin Chappell - 8 years ago