Re: [Vala] GLib.Rex Pattern
- From: Igor Azevedo <igor azevedo neticle pt>
- To: Daniel Espinosa <esodan gmail com>
- Cc: Vala-list <vala-list gnome org>
- Subject: Re: [Vala] GLib.Rex Pattern
- Date: Fri, 5 Apr 2013 20:36:03 +0000
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]