Regular Expressions 101

Community Library

Community Library Entry

9

Regular ExpressionOpen Workspace

/
(?<=\d\/|\.be\/|v[=\/])([\w\-]{11,})|^([\w\-]{11})$
/
gim

Description
Created·2013-11-28 13:30
Type·Match
Flavor·PCRE (Legacy)

This regex will match any Youtube video ID thrown at it and return one capturing group containing the ID.

Submitted by Jacob Overgaard
Open Workspace