refactoring regex to remove query string and jsessionid