[Vala] Regex question
- From: Бака Гайдзин <troorl gmail com>
- To: vala-list gnome org
- Subject: [Vala] Regex question
- Date: Sun, 20 Dec 2009 14:50:26 +0200
I need to replace all URLs in text on links. I'm doing the following things:
urls = new Regex("((http|https|ftp)://([\\S]+))");
var result = urls.replace(text, -1, 0, "<a href='\\0'>\\0</a>");
Ok, this works fine. But also I need to cut long URLs (longer than 20
chars, for example). How can I do this thing? I look to the
replace_eval method, but I don't understand how to use it.
Thanks in advance and sorry for my English.
] [Thread Prev