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 iframe embed code src video id and params
Open Workspace
JavaScript
Match
Created 2018-06-13 08:42
0
Regular Expression
/
<iframe
[
\s\w
="
\/
]
*
src="
(?<src>
(?:
https
*
:
\/\/
)?
www
\.
youtube
(?:
-nocookie
)?
\.
com
\/
embed
\/
(?<vid>
[
-a
-
zA
-
Z0
-
9@:;%_+.~#&=
]
+
)
\?
?
(?<params>
[
-a
-
zA
-
Z0
-
9@:;%_+.~#?&
\/
=
]
*
)
)
"
[^
>
]
*
>
(?:
<
\/
iframe>
)?
$
/
gm
Description
Matches full src url and individual video id and params in a YouTube iframe embed tag.
Submitted by
Robert Klein Kromhof