QRegExpreURL("(\\s|^)"//start with whitespace or beginning of line
"("
"("//case 1 -- URL with scheme
"(http(s?))\\://"//start with scheme
"([a-zA-Z0-9_-]+\\.)+"// domainpart. at least one of these must exist
"([a-zA-Z0-9\\?%=&/_\\.:#;-]+)"// everything to 1st non-URI char, must be at least one char after the previous dot (cannot use ".*" because it can be too greedy)
")"
"|"
"("//case 2a -- no scheme, contains common TLD example.com
"([a-zA-Z0-9_-]+\\.)+"// domainpart. at least one of these must exist
"(?="// must be followed by TLD
"AERO|aero|"//N.B. assertions are non-capturing
"ARPA|arpa|"
"ASIA|asia|"
"BIZ|biz|"
"CAT|cat|"
"COM|com|"
"COOP|coop|"
"EDU|edu|"
"GOV|gov|"
"INFO|info|"
"INT|int|"
"JOBS|jobs|"
"MIL|mil|"
"MOBI|mobi|"
"MUSEUM|museum|"
"NAME|name|"
"NET|net|"
"ORG|org|"
"PRO|pro|"
"RO|ro|"
"RU|ru|"
"TEL|tel|"
"TRAVEL|travel"
")"
"([a-zA-Z0-9\\?%=&/_\\.:#;-]+)"// everything to 1st non-URI char, must be at least one char after the previous dot (cannot use ".*" because it can be too greedy)
")"
"|"
"("// case 2b no scheme, no TLD, must have at least 2 aphanum strings plus uncommon TLD string --> del.icio.us
"([a-zA-Z0-9_-]+\\.){2,}"//2 or more domainpart. --> del.icio.
"[a-zA-Z]{2,}"//one ab (2 char or longer) --> us
"([a-zA-Z0-9\\?%=&/_\\.:#;-]*)"// everything to 1st non-URI char, maybe nothing in case of del.icio.us/path