Re: [Vala] regex to get some multiline text



On Wed, May 9, 2012 at 8:36 AM, "Luis L. Rodríguez Oro" <luisr uci cu>wrote:

I try write a regular expresion to get some text, something like this:


I'm not 100% sure on your use case, I didn't read it thoroughly, but I
believe you need to add a loop:

if(r.match(the_string, 0, out info)) {
while (true) {
           var s = info.fetch_named("start");
           var key = info.fetch_named("key");
           var cont = info.fetch_named("content");
           var e = info.fetch_named("end");

           print("%s\n",s);
           print("%s\n",key);
           print("%s\n",cont);
           print("%s\n",e);
if (!info.next()) break;
}
       }

HTH
Shawn


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