Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
(youtu\.be\/|youtube(-nocookie)?.com\/(v\/|e\/|.*u\/\w+\/|embed\/|.*v=))([\w-]{11})
/
g

Description

any format, check domain to make sure it's a youtube url

Submitted by Mantish - 9 years ago