Comments (2)
Hey @wbrian-onlineed
Thank you for bringing this up. As of now, all expressions require a comparison operator. Try something like this:
/a/.test('a') === true && /x/.test('x') === true
I know it's not very intuitive, but it's an issue that resides from where the project originally started. I will eventually fix this at some point.
Let me know if this works for you.
EDIT:
Here are some working examples:
https://github.com/nicoSWD/php-rule-parser/blob/master/tests/integration/methods/TestTest.php
from php-rule-parser.
This does not work ;-(
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 '.'".
This test should produce the error:
$rule = new Rule('/foo/.test(foo) === true && /bar/.test(foo) === false', ['foo' => 'foo']);
var_dump($rule->isTrue()); // PHP error
from php-rule-parser.
Related Issues (15)
- CVE-2018-14040 (Medium) detected in bootstrap-3.3.7-3.3.13.min.js
- CVE-2018-14042 (Medium) detected in bootstrap-3.3.7-3.3.13.min.js
- CVE-2018-20677 (Medium) detected in bootstrap-3.3.7-3.3.13.min.js
- CVE-2019-11358 (Medium) detected in jquery-3.1.1.min.js
- Negative Containment check possible? HOT 2
- CVE-2020-11022 (Medium) detected in phpunit/php-code-coverage-7.0.10, jquery-3.4.1.min.js
- CVE-2020-11023 (Medium) detected in phpunit/php-code-coverage-7.0.10, jquery-3.4.1.min.js
- CVE-2019-8331 (Medium) detected in bootstrap-4.1.3.min.js
- Being worked on? HOT 3
- Fatal error with Bool variables and ||
- Cannot use variables where one of the keys has a dash in it. HOT 4
- How to can I register a new function? HOT 3
- ReadMe Mis-type? HOT 2
- This is a test issue from WhiteSource, it will be closed shortly
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-rule-parser.