Re: [Vala] GLib.Rex Pattern



Daniel Espinosa, if you're going to write strings with multiple lines you
might wanna use the verbatin feature.

For example:

public static string PATTERN= """(([0-2]?[0-5]{1,2})|([0-1]\d\d)|(\d
\d))\.(([0-2]?[0-5]{1,2})|([0-1]\d\d)|(\d
\d))\.[0-2]?[0-5]{1,2}\.(([0-2]?[0-5]{1,2})|([0-1]\d\d)|(\d\d))""";

Otherwise you can just put the whole string in just one line.


2013/4/5 Daniel Espinosa <esodan gmail com>

I want to set a static string to a class with a GRex pattern.

Is this supported by Vala?

I'm using:

class Ip : Object  {
        public static string PATTERN="(([0-2]?[0-5]{1,2})|([0-1]\d\d)|(\d
\d))\.(([0-2]?[0-5]{1,2})|([0-1]\d\d)|(\d
\d))\.[0-2]?[0-5]{1,2}\.(([0-2]?[0-5]{1,2})|([0-1]\d\d)|(\d\d))"
}

On compile I get error for invalid scape sequence.
--
Daniel Espinosa <esodan gmail com>

_______________________________________________
vala-list mailing list
vala-list gnome org
https://mail.gnome.org/mailman/listinfo/vala-list



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