-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
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.
Metadata
Metadata
Assignees
Labels
No labels