Created
July 27, 2016 16:31
-
-
Save jspc/273c61edb60c617289a4c44fac011004 to your computer and use it in GitHub Desktop.
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 uri = "http://domain.com:80/articles/something"; | |
var regexp = /http:\/\/([^\/]+):[0-9]+\/articles\/[^\/]+/; | |
var matches = regexp.exec(uri); | |
console.log(matches); | |
//[ 'http://domain.com:80/articles/something', | |
// 'domain.com', | |
// index: 0, | |
// input: 'http://domain.com:80/articles/something' ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment