I need to extract the filename + extension for any request having only a .aspx extension from within the request url. For ex. if the requested url is – http://www.abcd.com/index.aspx?a=1&B=2 then it should return index.aspx. If the requested url is http://abcd.com/products/pages/page1 then it should return empty.If the requested url is http://abcd.com/images/img1.gif then it should return empty.
Edit: If there is an aspx anywhere else in the url then it might pose the actual problem. but properly escaping the . and looking for the . within the url, and getting first match might solve the problem as hostname’s usually dont have .aspx in them.
Try this: