Re: [Vala] Regex question



Ok, I solved the problem with match_all_full in loop.

2009/12/20 Бака Гайдзин <troorl gmail com>:
Hi.

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.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]