Regular Expressions 101

Library entries

get video id from youtube link

Vote

1

Regular Expression
pcre

/
^(?:https?:\/\/)?(?:(?:www\.)?youtube\.com\/(?:(?:v\/)|(?:embed\/|watch(?:\/|\?)){1,2}(?:.*v=)?|.*v=)?|(?:www\.)?youtu\.be\/)([A-Za-z0-9_\-]+)&?.*$
/
gmi

Description

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