开发者

Match all after hostname

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 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜