I want a regex that will always return the last part of an url before the query string parameters and without the jessionid if present.
Here's some url examples:
http://www.somesite.com/some/path/test.action;jsessionid=000063vCmvJAn7VWyymA_dPsHZs:16u9pglit?sort=2¶m1=1¶m2=2
http://www.somesite.com/some/path/test;jsessionid=000063vCmvJAn7VWyymA_dPsHZs:16u9pglit?sort=2¶m1=1¶m2=2
http://www.somesite.com/some/path/test.action?sort=2¶m1=1¶m2=2
http://www.somesite.com/some/path/test?sort=2¶m1=1¶m2=2
Here's my regex so far:
.*http://.*/some/path.*/(.*);?.*\?.*
It is working for the url that does not contain jsessionid, but will return test;jessionid=...
if it is present.
To test: http://regex101.com/r/fM0mE2