You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I understand that there needs to be an explicit equality operator present. However, even when present, the parser does not handle two or more tests in the same rule. It will fail with PHP error "preg_match(): Unknown modifier '.'".
If a function contains more than one instance of the
test
function, it complains of a parse error// example bad rule:
/a/.test('a') && /x/.test('x')
Error: "preg_match(): Unknown modifier '.'"
File: nicoswd/php-rule-parser/src/Grammar/JavaScript/Methods/Test.php
Line: 46
Function: preg_match
PHP Version: 7.4.3 (ubuntu)
I have tried reordering them, changing contents of test, and removing "i" modifier. It simply doesn't like it when there are two.
Related side issue: documentation provides use as
"foo".test(/oo/i)
but actual usage requires the reverse:/oo/i.test("foo")
Thanks for providing this helpful utility.
The text was updated successfully, but these errors were encountered: