Regular Expressions 101

Community Patterns

Youtube Regex

1

Regular Expression
PCRE (PHP <7.3)

/
(?:https?:)?(?:\/\/)?(?:[0-9A-Z-]+\.)?(?:youtu\.be\/|youtube(?:-nocookie)?\.com\/\S*?[^\w\s-])((?!videoseries)[\w-]{11})(?=[^\w-]|$)(?![?=&+%\w.-]*(?:['"][^<>]*>|<\/a>))[?=&+%\w.-]*
/
igm

Description

no description available

Submitted by anonymous - 5 years ago