开发者

asp.net boolean search string function

开发者 https://www.devze.com 2023-02-26 16:12 出处:网络
Any of you know how to do boolean search engine in asp.net c# application, i have to search the given string (search the string using boolean logic AND,OR,NOT) in my asp.net applicatio开发者_运维知识库

Any of you know how to do boolean search engine in asp.net c# application, i have to search the given string (search the string using boolean logic AND,OR,NOT) in my asp.net applicatio开发者_运维知识库n(only aspx and html files)...

please help me...


Basically, you need to parse the input (split the string, then iterate through the words) and construct a tree. Since the operators (AND, OR, ...) are between the keywords, you need an infix parser.

You can either write one yourself (the keyword "infix parser" should return enough Google results to get you started -- note that this is not a trivial task if you don't have at least some computer science background) or use a tool such as ANTLR, which is supposed to make writing parsers easy.

Here's a related question; I'm not sure if the answer is applicable to your case, though:

  • Are there any good tutorials that describe how to use ANTLR to parse boolean search strings


In the find and replace window :CTRL + SHIFT + F

  • check "use" and select "regular expression"

This triangular button next to the Find what field becomes available when the Use check box is selected in Find options. Click this button to display a list of wildcards or regular expressions, depending upon the Use option selected. Choosing any item from this list adds it into the Find what string. - MSDN

So you will have to build your "boolean logic search" using Regular expression (And now you have 2 problems)

Also set the Look at these files types: to *.html;*.aspx; and Look in Entire Solution

asp.net boolean search string function

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号