diff --git a/src/Support/Expression.php b/src/Support/Expression.php index 7ce5395..7ce8fff 100644 --- a/src/Support/Expression.php +++ b/src/Support/Expression.php @@ -86,8 +86,8 @@ public function priority($operator) public function lex($string) { - $bad = [' or ', '-', ' ', '@', '.']; - $good = [ '|' , '~', '&', '&', '&']; + $bad = [' or ', ' -', ' ']; + $good = ['|', '~', '&']; $string = str_replace($bad, $good, $string); $string = mb_strtolower($string); diff --git a/tests/support/ExpressionTest.php b/tests/support/ExpressionTest.php index a42c804..dddccd3 100644 --- a/tests/support/ExpressionTest.php +++ b/tests/support/ExpressionTest.php @@ -15,7 +15,6 @@ public function testToPostfix() $this->assertEquals(['great', 'awsome', '|'], $exp->toPostfix("great or awsome")); $this->assertEquals(['great', 'awsome', '&'], $exp->toPostfix("great awsome")); $this->assertEquals(['email', 'test', '&', 'com', '&'], $exp->toPostfix("email test com")); - $this->assertEquals(['email', 'test', '&', 'com', '&'], $exp->toPostfix("email@test.com")); $this->assertEquals(['first', 'last', '&', 'something', 'else', '&', '|'], $exp->toPostfix("(first last) or (something else)")); } }