Created
April 22, 2015 18:06
-
-
Save saptak/5f1de4173f9d6e85e122 to your computer and use it in GitHub Desktop.
find location of the port number in a URL
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 str1="http://127.0.0.1:5000"; | |
var str2="http://blah.blah.com"; | |
var i1=str1.search(/:\d/); | |
console.log(i1); | |
i1=str2.search(/:\d/); | |
console.log(i1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment