Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
^(http(s)??\:\/\/)?(www\.)?((youtube\.com\/watch\?v=)|(youtu.be\/))([a-zA-Z0-9\-_])+$
/
g
Unit Tests
https-www-full
http-www-full
https-full
http-full
https-short
http-short
www-full
full
www-short
https-www-short
not-match-1
not-match-2
not-match-3
https://www.youtube.com/watch?v=IkbqNY0F…
→ regex does match
missing-video-id