Message-Id: Comments: Authenticated sender is From: "Salvador Eduardo Tropea (SET)" Organization: INTI To: random AT visi DOT net (Michael Bosley), djgpp AT delorie DOT com Date: Fri, 15 May 1998 17:50:13 +0000 MIME-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-transfer-encoding: 7BIT Subject: Re: Q: How to call a function like search(sentence for string1 In-reply-to: <355c8df9.92989021@news> Precedence: bulk random AT NO-FREAKIN'-SPAM.visi.net (Michael Bosley) wrote: > Hi all, > > I am writing a search function to find substrings in sentences using > AND and OR logic and I would like to know if there is any way to do > something like: > > int result = search("This is a test sentence" for "test" AND ("this" > OR "This")); > > Any ideas? Just an idea: Perhaps you can use regular expressions. If the user is the one that type the text is a little harder because you must convert the "or"/"and" stuff to the regex syntax. Advantages: You can do much more powerfull searchs. Disadvantage: Is sloooowwww, well that depends on the reference, but is 10 times slower than a simple search. SET ------------------------------------ 0 -------------------------------- Visit my home page: http://set-soft.home.ml.org/ or http://www.geocities.com/SiliconValley/Vista/6552/ Salvador Eduardo Tropea (SET). (Electronics Engineer) Alternative e-mail: set-soft AT usa DOT net set AT computer DOT org ICQ: 2951574 Address: Curapaligue 2124, Caseros, 3 de Febrero Buenos Aires, (1678), ARGENTINA TE: +(541) 759 0013