I am looking for a way to parse user input. The input should show which searches should be performed and how to combine them.
- 1 and 2
- (3 AND 2) OR 1
- (3 AND 2) OR (1 AND 4)
- ((3 OR 4) AND 1) OR 2
- and etc.
The first example is to combine the search results 1 and 2 in the AND mode. The second example is to combine the search results 3 and 2 in the AND mode and combine the results of this combination with the search results 1 in the OR mode. Etc.
Any ideas on how to do this?
source
share