How can I match all that comes after a hostname. If I have:
http://test.someweb.net/category/subcategory/?some开发者_JAVA技巧=value
I want to match:
/category/subcategory/?some=value
/http:\/\/[^/]+(.*)/
The first matched group ((.*)
) is the one you need.
url = "http://asjahsjahsjahs.ashags.asjahs/andbcb/c/d"
m = url.match(/https?:\/\/[^\/]*(\/.*)/);
m[1] ; //# => /andbcb/c/d
精彩评论