Created
April 16, 2014 08:19
-
-
Save KxNxT/10831053 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "https://www.youtube.com/watch?v=cvj3-MZO9Tw&list=dddd"; | |
document.getElementById('helloWorld').innerHTML = str.replace(/.*v=([\d\w\-]+).*/,"$1"); | |
var str2 = "//www.youtube.com/embed/cvj3-MZO9Tw&list=dddd"; | |
document.getElementById('helloWorld2').innerHTML = str2.replace(/.*embed\/([\d\w\-]+).*/,"$1"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
2つめは必ずembed/の後に続くのかは不明