Regex to match pattern with subdomain in java gives issues
- by Ramesh
I am trying to match the sub domain of an url using http://([a-z0-9]*.)?example.com/.* which works perfectly for these cases.
http://example.com/index.html
http://test.example.com/index.html
http://test1.example.com/index.html
http://www.example.com/122/index.html
But the problem is it matches for this URL too.
http://www.test.com/?q=http://example.com/index.html
if an URL with another domain has the URL in path it matches.Can any one tell me how to match for current domain only. getting the host will work but i need to match full URL.