[ Thread Index |
Date Index
| More lists.tuxfamily.org/slitaz Archives
]
- To: slitaz@xxxxxxxxxxxxxxxxxxx
- Subject: Re: Maybe Leaving slitaz
- From: Aleksej Bobylev <al.bobylev@xxxxxxxxx>
- Date: Fri, 20 Jul 2012 02:23:10 +0000
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=uV/4BQvwkelyenXbWB3SMbApp3oB2hLSzP580QBQ8jc=; b=cFyt4Dzq8zTbo9wcMdlGplmIMXf11ey0PZAhPBm58HvwLxfjlTYZ5SkYuROIHQjYzO 52V6plZqnmi1SmQV1um9YOfFrhdB1aJ54naLPqS7JOD0tBgRPxmQFI+vm9LBD5SQfo3V 9WiSN3kSxKZEn6yIA0WMjsuWuPg9LJClooDeufl3iezGhSIUaLM2YsjipauqJFQYbWTE A8eVW4WmDakQxkmM1yzuDY7KrxVOCRy3mOAvW52cbwOwcXL9NgP1lG2nPTKG5xtaee19 E86DfDm9hia5qjuFb2aaOKDOa3dKnqLtUQw5C+SbJ2sotZamiiEhJewLfj0ZkzOvXsK8 yhTg==
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/