Regular Expressions 101

Community Patterns

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(?:https?:\/\/(?:www)?\.?y(?:2u\.be|outu\.be|outube.com)\/)(?:watch\?v=)?([\w\d]+)
/
gmi

Description

Detects YouTube link in the standard format and shortcuts and it receives the ID of the YT video.

Submitted by Velidan - 3 years ago