Like argv0 said, regex is the best option:
Code:
  var %d = com|edu|gov|mil|net|org|biz|info|name|museum|us|ca|uk
  var %url = /(?<=^|\s)((?>\S{3,8}:\/\/|w{3}\56)\S+)|\56( $+ %d $+ )\b/iS
  if ($regex($1-,%url)) { ;do something