Created
February 7, 2013 13:49
-
-
Save stugoo/4731031 to your computer and use it in GitHub Desktop.
Get src attribute from string
This file contains 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 input = '<iframe width="560" height="315" src="http://www.youtube.com/embed/_QtoHqZPkk0" frameborder="0" allowfullscreen></iframe>', | |
rawurl = new String(input).match(/src=["']?((?:.(?!["']?\s+(?:\S+)=|[>"']))+.)["']?/)[1]; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment