diff --git a/src/Math.php b/src/Math.php index ec7f736..34c5532 100644 --- a/src/Math.php +++ b/src/Math.php @@ -140,7 +140,12 @@ protected function parseOperator(TerminalExpression $expression, Stack $output, } protected function tokenize($string) { - $parts = preg_split('(([0-9]*\.?[0-9]+|\+|-|\(|\)|\*|%|\/|:|\?|==|<=|>=|<|>|!=|&&|\|\|)|\s+)', $string, null, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE); + $parts = preg_split( + '(([0-9]*\.?[0-9]+|\+|-|\(|\)|\*|%|\/|:|\?|==|<=|>=|<|>|!=|&&|\|\|)|\s+)', + $string, + null, + PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE + ); $parts = array_map('trim', $parts); return $parts; }