Print Page | Close Window

Filter wild word

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5116
Printed Date: 30 March 2026 at 6:12pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Filter wild word
Posted By: Aumuz
Subject: Filter wild word
Date Posted: 18 August 2003 at 10:16pm

"my name is Phillip"

Can anyone help me make some code to filter the above sentence.

What I wan't it to do is, reconize the words "my name is" and then set a string (EX: str_username) to that (so str_username="Phillip").

Can anyone help me on this?




Replies:
Posted By: b_bonnett
Date Posted: 19 August 2003 at 4:49am

Try the following:

intStart = InStr(strToSearch,  "my name is")
If intStart > 0 Then
  intStart = intStart + 11
  intEnd = InStr(intStart, strToSearch, " ")
  strUsername = Mid(strToSearch, intStart, intEnd)
End If

This is written off the top of my head, so you might need to play around with the numbers to get it working correctly.

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: Aumuz
Date Posted: 19 August 2003 at 7:44am

Ok, thanks!

(I can't get it to work yet, but I will play around with it.)

By the way, in case anyones curious, I am using this to make a faq/forum/chat bot. And this is definetly going to cut down on "brain" (a access database) space... Otherwise I need to enter every possible sentece myself, and the bot would have no learning capabilities...

So thanks for your help!



Posted By: b_bonnett
Date Posted: 20 August 2003 at 4:11am

I think changing intStart = intStart + 11 to intStart = intStart + 12 would fix it.

Blair



-------------
Webmaster, http://www.planegallery.net/ - The Plane Gallery
Greetings From Christchurch


Posted By: Aumuz
Date Posted: 27 August 2003 at 8:39am

(oops! sorry I forgot about this...)

I will try that out once I get a chance...

More less just wanted to say thanks for you help.



-------------
Cheers!
Aumuz.

visit me at my homepage http://www.oursaintann.com - www.oursaintann.com



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net