Re: [Vala] GLib.Rex Pattern



Hello,

Le vendredi 5 avril 2013, Daniel Espinosa a écrit :

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.


\d is an invalid escape sequence. Since you need a backslash, you need to
either escape it (by doubling it) or use a literal string """...""".

HTH,
Abderrahim


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