Esempio n. 1
0
 static function init()
 {
     $r = 'strip_regex';
     self::$whitespace = '/\\s+/m';
     self::$parentheses = '/\\(|\\)/m';
     self::$filter_end = '/;/';
     self::$boolean = '/true|false/';
     self::$seperator = '/,/';
     self::$pipe = '/\\|/';
     self::$operator = '/\\s?(>|<|>=|<=|!=|==|!|and |not |or )\\s?/i';
     self::$number = '/\\d+(\\.\\d*)?/';
     self::$name = '/[a-zA-Z][a-zA-Z0-9-_]*(?:\\.[a-zA-Z_0-9][a-zA-Z0-9_-]*)*/';
     self::$string = '/(?:
             "([^"\\\\]*(?:\\\\.[^"\\\\]*)*)" |   # Double Quote string   
             \'([^\'\\\\]*(?:\\\\.[^\'\\\\]*)*)\' # Single Quote String
     )/xsm';
     self::$i18n_string = "/_\\({$r(self::$string)}\\) | {$r(self::$string)}/xsm";
     self::$named_args = "{\r\n            ({$r(self::$name)})(?:{$r(self::$whitespace)})?\r\n            : \r\n            (?:{$r(self::$whitespace)})?({$r(self::$i18n_string)}|{$r(self::$number)}|{$r(self::$name)})\r\n        }x";
 }