If for some reason you only need a regular expression, try the following:
((?<=http:
I’ve expanded the URL character set ( [a-zA-Z0-9\/\.#?/%]) a bit to include a few important ones, but this should by no means be precise or comprehensive.
The regular expression is a little monster, so I will try to break it:
(?<=http:
URL-. http://[a-zA-Z0-9\/\.#?/%]+ URL-, (?=[^a-zA-Z0-9\/\.#?/%]) , URL- URL-, . , URL- , . lookbehind (?<=...), , .
URL- . \A(?!http://[a-zA-Z0-9\/\.#?/%]) (\A), , , URL- . ( URL- , , URL-, .)
OR 'd |. .+? , .
((?=http://[a-zA-Z0-9\/\.#?/%])|\Z). URL-, (?=http://[a-zA-Z0-9\/\.#?/%]). , , , \Z. , OR .
| , , OR.
( \A \Z ). , - ( perl), Start Lookahead Lookbehind.
, !