|
 |
asp_web_howto thread: logical errors when searching
Message #1 by "Frode" <fstroemm@o...> on Tue, 10 Sep 2002 09:59:14
|
|
Hello,
I would like to make a search script that query a database for
name,address etc.
My problem is that I would like to get matches for different typed in
addresses. Hilmar Street 57, hil. street 57, hilmar st. 57 would all match
for example.
Is there a way to do this in asp? I guess I have to take the string apart
and somehow insert a different query if . is found or something.
Any ideas or websites I could be directed to?
thanks
- Frode
Message #2 by jeff.montgomery@m... on Sun, 15 Sep 2002 04:20:17
|
|
> My problem is that I would like to get matches for different typed in
> addresses. Hilmar Street 57, hil. street 57, hilmar st. 57 would all
match
> for example.
What you need is Regular Expressions. It is a more intelligent searching
engine than just searching for a fixed string. Microsoft has an
implementation of it in recent versions of VBScript (and hence ASP). Check
this article:
http://www.aspalliance.com/brettb/VBScriptRegularExpressions.asp, and also
the "Further Reading" links at the bottom of the page.
I believe a RegEx pattern that would match all 3 of the above would
be "[Hh][Ii][Ll].*57".
Jeff Montgomery
jeff.montgomery@m...
Message #3 by jeff.montgomery@m... on Sun, 15 Sep 2002 04:23:50
|
|
One more thing... you said you wanted to do the search in the database.
Unfortunately, I don't know of a way to do the RegEx stuff directly with
SQL, but you can still select the records you want to check, then loop
through the Recordset and check the contents of the fields with your RegEx
code.
Jeff Montgomery
jeff.montgomery@m...
|
|
 |