Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
YouTube Embed Video & Playlist from URL
Open Workspace
JavaScript
Substitution
Created 2015-03-11 17:45
2
Regular Expression
/
(
https
?
:
\/\/
)?(
www
.
)?(
youtube
\.
com
|
youtu
\.
be
|
youtube-nocookie
\.
com
)
\/
(?:
embed
\/
|
v
\/
|
watch
\?
v=
|
watch
\?
list=
(
.
*
)
&v=
)?(
(
\w
|
-
){11}
)(
&list=
(
\w
+
)
&
?
)?
/
i
Description
It gets the playlistID and the videoID to conform the embed URL from the video URL
Submitted by
@rubenlopezgea