Example #1
0
 public static function parse($string)
 {
     // execute the global replacement
     self::$_PES = array();
     // simulate the _patterns.toSTring of Dean
     $regexp = '/';
     foreach (self::$_PPP as $reg) {
         $regexp .= '(' . substr($reg[self::_PEX], 1, -1) . ')|';
     }
     $regexp = substr($regexp, 0, -1) . '/';
     $regexp .= self::$_PIC ? 'i' : '';
     $string = self::_parse_escape($string, self::$_PEC);
     $string = preg_replace_callback($regexp, array('self', '_parse_replace'), $string);
     $string = self::_parse_unescape($string, self::$_PEC);
     return preg_replace(self::$_PPD, '', $string);
 }