tglogo.png
0 LIKES

Snippet


URL with highlighted text by Matt5150

In Category General IRC Posted by Snippets On 12/06/23

Usage: $d.url(text text text https://www.google.it/ text)
Return: alt text
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
}


Comments 0


Please note that on our website we use cookies necessary for the functioning of our website, cookies that optimize the performance. To learn more about our cookies, how we use them and their benefits, please read our Cookie Policy.
I Understand