Sephiroth
http://sephiroth.scifi-action.de/board/

$links
http://sephiroth.scifi-action.de/board/viewtopic.php?f=4&t=33
Seite 1 von 1

Autor:  Sephiroth [ 18. März 2008 00:22 ]
Betreff des Beitrags:  $links

;; shows links underlined in the text
;; usage $links(text www.link.de text?)

alias links {
  if ($isid) {
    set -un %a $1-
    tokenize 124 www.*.??*|ftp://*.??*|http://*.??*|*?@???*.??*
    var %x = $0 | while (%x) { rep $($+($,%x),2) %a | dec %x }
    tokenize 32 %a | unset %a | return $1-
  }
  else { !links $1- }
}
alias -l rep { if ($wildtok($2-,$1,0,32)) { var %i = $ifmatch,%y,%x | %y = $2- | while (%i) { %x = $wildtok(%y,$1,%i,32) | if ( !isin %x) { %a = $replace(%a,%x, $+ $wildtok(%y,$1,%i,32) $+ ) } | dec %i } } }

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/