Please refer to below regular expression
message = message.replaceAll("(?:https?|http?)://[\\w/%.\\-?&=!#]+(?!.*\\[/)",
"$0");
I also notice that certain links like http://www.google.com.sg/#hl=en&output=search&sclient=psy-ab&q=test&oq=&aq=&aqi=&aql=&gs_sm=&gs_upl=&gs_l=&psj=1&bav=on.2,or.r_gc.r_pw.r_qf.,cf.osb&fp=37e992000c3eb140&biw=1366&bih=638 is not able to convert to html hyperlink successfully.
Can anyone advise how to improve the regular expression?