Regular Expressions 101

Library entries

extract video id from youtube url

Vote

1

Regular Expression
pcre

/
(https?:\/\/)?(www.)?(youtube\.com|youtu\.be|youtube-nocookie\.com)\/(?:embed\/|v\/|watch\?v=|watch\?list=(.*)&v=|watch\?(.*[^&]&)v=)?((\w|-){11})(&list=(\w+)&?)?
/
gims

Description

Loading markdown...
Submitted by egg- - 6 years ago