Validate a Boolean expression with brackets in C#

后端 未结 6 609
清歌不尽
清歌不尽 2021-01-18 01:12

I want to validate a string in C# that contains a Boolean expression with brackets. The string should only contain numbers 1-9, round brackets, \"OR\" , \"AND\".

Exa

6条回答
  •  时光说笑
    2021-01-18 01:46

    ANTLR Parser Generator?

    a short way of achieving this in C#

    Although it may be an overkill if its just numbers and OR + AND

提交回复
热议问题