Re: Maybe Leaving slitaz

[ Thread Index | Date Index | More lists.tuxfamily.org/slitaz Archives ]


I allow myself a little quote.

Jul 18 18:45:18 [godane] the syntexing is going to drive me nuts with nimrod
Jul 18 18:45:36 [godane] stuff like this: var lit =
url.replacef(re"(http://)*(www.)*([^/]+)(.*$)",
"<span>$1$2</span>$3<span>$4</span>")
Jul 18 18:46:29 [godane] this is why i have zero support of nimrod
Jul 18 18:48:15 [Trixar_za] You could also use re("")
Jul 18 18:48:16 [Trixar_za] :P
Jul 18 18:49:03 [Trixar_za] Also can't you read regular expression? Oo
Jul 18 18:49:37 [godane] full code came from here:
http://hg.slitaz.org/nim-tools/rev/c5c91502cc60

Yes, this is my code. It seems that I need to translate my procedure
on a world-accessible language.

Original:
proc link(url: string) =
  var lit = url.replacef(re"(http://)*(www.)*([^/]+)(.*$)",
"<span>$1$2</span>$3<span>$4</span>")
  echo("<a href=\"" & url & "\">" & lit & "</a>")

Translation:
#!/bin/sh
link()
{
	lit=$(echo $url | sed
"s/\(http:\/\/\)*\(www\.\)*\([^\/]*\)\(.*$\)/<span>\1\2<\/span>\3<span>\4<\/span>/")
	echo "<a href=\"$url\">$lit</a>"
}

url="http://www.robobunny.com/projects/asciiquarium/html/";
link

My lovely accordion! [:]/\/\/\[:]
;D

-- 
SliTaz GNU/Linux Mailing list - http://www.slitaz.org/


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/