Skip to content
TG007 community snippet #149

URL with highlighted text by Matt5150

Usage: $d.url(text text text https://www.google.it/ text) Return: alt text

By Snippets Added Dec 6, 2023
General IRC All snippets
mIRC script 14 lines
About this snippet

Overview

Usage: $d.url(text text text https://www.google.it/ text)
Return: alt text
Source code

mIRC script

14 lines · 419 characters
alias d.url {
  var %:text = $1-
  if ($regex(%:text,/(\b(www.?\.|https?:\/\/|ftp:\/\/).)/i)) {
    var %a = 1
    while (%a <= $numtok(%:text,32)) {
      if ($regex($gettok(%:text,%a,32),/(\b(www.?\.|https?:\/\/|ftp:\/\/).)/i)) {
        var %b = $+($chr(3),12,$chr(31),$gettok(%:text,%a,32),$chr(31),$chr(3))
        var %:text = $puttok(%:text,%b,%a,32)
      }
      inc %a
    }
  }
  return %:text
}
Community

Comments

Want to join the discussion? Sign in to TG007.
No comments yet. Start the discussion.