I have string expression as below
NOT (S:sira1_1810 OR S:sira2_1810 OR S:sira3_1810)
It should be converted as
(NOT S:sira1_1810) OR (NOT S:sira2_1810) OR (NOT S:sira3_1810)
Any ideas much appreciated.
I have string expression as below
NOT (S:sira1_1810 OR S:sira2_1810 OR S:sira3_1810)
It should be converted as
(NOT S:sira1_1810) OR (NOT S:sira2_1810) OR (NOT S:sira3_1810)
Any ideas much appreciated.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Mar 22, 2022, 4:03 PM EDT
mesharaasi38 reputationPosted Mar 22, 2022, 4:27 PM EDT
Muhammad Imran AnsariRank #326 · 7.6K reputationPosted Mar 22, 2022, 11:40 PM EDT
Asad AliRank #1,139 · 1.6K reputationPosted Mar 23, 2022, 4:02 AM EDT
mesharaasi38 reputationPosted Mar 23, 2022, 5:12 AM EDT
Thank you.
It's a rule engine we are trying to build. Before that we would need to evaluate the expression in correct format. "S:sira1_1810 " are selected options, If the user doesn't select (NOT) means, we need to trigger a message. If there is no "NOT" beside the option means it is "EQ" (equal). Since we need to execute in "AND","OR" order, we have to evaluate expression in the right format EX:
#1
Expression: NOT S:24zoll_1757 AND C:1757 AND C:1780
Conversion: (NOT S:24zoll_1757) AND (EQ C:1757) AND (EQ C:1780)
#2
Expression: (S:gr1_1778 OR S:gr2_1778 OR S:gr5_1778)
Conversion: ((EQ S:gr1_1778) OR (EQ S:gr2_1778) OR (EQ S:gr5_1778))
#3:
Expression: S:25zoll_1757 AND S:ber7_1756
Conversion: (EQ S:25zoll_1757) AND (EQ S:ber7_1756)
#4:
Expression: S:25zoll_1757 AND NOT S:ber7_1756
Conversion: (EQ S:25zoll_1757) AND (NOT S:ber7_1756)
Asad AliRank #1,139 · 1.6K reputationPosted Mar 24, 2022, 5:13 AM EDT