alias urlreg return /((?:(?:http)|(?:www)\.)\S+)|(\S+\.(?:com|org|edu|gov|net|tv|uk|cc|xxx|mil|co|us|se|fm|me|de|kr|sv|fr|jp|tk|be|ly|info|biz|us|in|mobi)\S*)/Sig
alias urlcolor return $+($chr(3), 12, $chr(31), $1-, $chr(31), $chr(3))
;trigger for the regex event only
on ^&$*:text:$($urlreg):*:{
;if we are in a channel, turn nick into @nick if applicable
var %nick = $iif($chan, $nick($chan, $nick).pnick, $nick)
;color all the linkes using the predefined alias above
var %msgs = $regsubex($1-, $urlreg, $urlcolor(\t))
;debugging stuffs
echo -a $1- ORIGINAL
echo -a %msgs REGSUBEX
;print the message, default timestamp, highlighting options, and nick coloring
echo -tcrl normal $iif($chan, $v1, $nick) $+(<, $chr(3), %color, %nick, $chr(3), >) %msgs
;prevent mIRC's default echo
haltdef
}