Regular Expressions 101

Library entries

YouTube video URL to video ID

Vote

0

Regular Expression
python

"
^(?:https?:\/\/|\/\/)?(?:(?:www\.|m\.)?youtube(?:-nocookie)?\.com\/(?:(?:vi?|e|embed)\/([\w-]{11})|(?:watch|embed|attribution_link)?\?\S*?(?:(?<=\?v=|&v=)|(?<=\?vi=|&vi=))([\w-]{11}))|youtu\.be\/(?:([\w-]{11})(?!\S*v=)|\S*?(?:&v=|\?v=)([\w-]{11})))(?:[^\w-]\S*)?$
"
gm

Description

Loading markdown...
Submitted by Lyroy TheToad - a month ago