I need a URL pattern that can recognize all the urls in plain text. Now I have one that is working fine in Java (using Pattern): ("(@)?(http(s)?://)?[a-zA-Z_0-9\-]+(\.\w[a-zA-Z_0-9\-]+)+(/[#&\n\-=?\+\%/\.,\w]+)?")
It recognizes most of the URLs such as:
www.aaa.com
aaa.com
www.aaa.com/abcd/asdf?a=12
but it could NOT recognize the URLs with port number like www.aaa.com:8000 or www.aaa.com:8000/asdf
Can any of the regular expression experts help me to solve this problem making the above pattern recognizes URLs with port number?