Fix bug 54568

I changed the regex to a more complex thing to handle
the problem of catching ")" at the end of URL if it's
used in bracket

I tested it on several different texts and it was okay

Change-Id: I6f3addcaf93d4d7499e3ec169255f284ab70a526