Reputation: 3566
How can I match all that comes after a hostname. If I have:
http://test.someweb.net/category/subcategory/?some=value
I want to match:
/category/subcategory/?some=value
Upvotes: 0
Views: 268
Reputation: 14503
url = "http://asjahsjahsjahs.ashags.asjahs/andbcb/c/d"
m = url.match(/https?:\/\/[^\/]*(\/.*)/);
m[1] ; //# => /andbcb/c/d
Upvotes: 0
Reputation: 31564
/http:\/\/[^/]+(.*)/
The first matched group ((.*)
) is the one you need.
Upvotes: 2