We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
"include": "(INT>1)&(CHR>3)&(EVT?[10101])&(TLT?[1028])", "include": "(INT>2)&(CHR>4)&(EVT?[10101])", 怎么用一套代码判断类似这样的条件呢?有大佬给个思路吗?
The text was updated successfully, but these errors were encountered:
写一个复杂一点的做为例子
((INT>1|CHR>3)&(MNY>5|STR>8))|TLT?[1001,1002]|(EVT=10001&(INT>5|CHR>9))
()
|
&
[ [ ["INT>1", "|", "CHR>3"], "&", ["MNY>5", "|", "STR>8"] ], "|", "TLT?[1001,1002]", "|", [ "EVT=10001", "&", ["INT>5", "|", "CHR>9"] ] ]
按层判断结果,每一层的偶数位必定是子条件,偶数位必定是逻辑符号,从左到右判断各子句 先判断第一个子句,作为基准结果 如果有下一个子句,先判断逻辑符号
子条件的判断 将整子条件用 > >= < <= = != ? ! 等符号分割为 property symbol condition 例
>
>=
<
<=
=
!=
?
!
property
symbol
condition
INT>1
INT
1
MNY>5
MNY
5
TLT?[1001,1002]
TLT
[1001,1002]
EVT=10001
EVT
10001
然后根据 property 取得相应值,进行逻辑判断即可 *?[] 表示判断前值是否在数组中,如果前值为数组,则逐一判断 *![] 表示判断前值是否不数组中,如果前值为数组,则逐一判断
?[]
![]
Sorry, something went wrong.
变成 js eval来执行
No branches or pull requests
"include": "(INT>1)&(CHR>3)&(EVT?[10101])&(TLT?[1028])",
"include": "(INT>2)&(CHR>4)&(EVT?[10101])",
怎么用一套代码判断类似这样的条件呢?有大佬给个思路吗?
The text was updated successfully, but these errors were encountered: