delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/05/15/16:42:13

Message-Id: <m0yaRHz-000S2iC@inti.gov.ar>
Comments: Authenticated sender is <salvador AT natacha DOT inti DOT gov DOT ar>
From: "Salvador Eduardo Tropea (SET)" <salvador AT inti DOT gov DOT ar>
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
Subject: Re: Q: How to call a function like search(sentence for string1
In-reply-to: <355c8df9.92989021@news>

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

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019