Regular Expressions 101

Community Patterns

Community Library Entry

3

Regular Expression
PCRE (PHP <7.3)

/
^.*(youtu.be\/|v\/|u\/\w+\/|embed|e\/|watch\?v|\?v=|\&v=)([^#\&\?]{11,11}).*
/
gm

Description

youtube id 17 matches

Submitted by Wiliam Castilhos, Ramon Barros - 10 years ago