Community Patterns

Community Library Entry

0

Regular Expression
Created·2019-12-23 17:16
Flavor·PCRE (Legacy)

/
^(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/watch\?v=([a-zA-Z0-9_]+)|youtu\.be\/([a-zA-Z\d_]+))(?:&.*)?$
/
gm
Open regex in editor

Description

Matches Youtube video links

Matches the video id as (group 1) for regular youtube links.

Matches the video id as (group 2) for shared Youtube links.

Submitted by anonymous