Current location: Hot Scripts Forums » Programming Languages » ASP » RegExp Question


RegExp Question

Reply
  #1 (permalink)  
Old 05-28-04, 08:15 AM
Daemon Daemon is offline
Newbie Coder
 
Join Date: Oct 2003
Location: Virginia
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
RegExp Question

I'm trying to make a word filter system, and I've got a table full of words and the replacement words, etc, but my regular expression isn't replacing them properly. I want to be able to set filters to loose or exact. Loose meaning that all instances of the word will be replaced, even if they occur inside another word. Exact means only the exact word will be replaced. Simple enough, or so I thought.

I have a field in the table called Type, which is a bit. If it's 1, then it's exact, if it's 0, then it's loose.

Here's the code I have for that:
Code:
		If(adoRs.fields("Type")) Then
			regex.pattern = lcase(adoRs.fields("Word")) & "[ \n]"
		Else
			regex.pattern = "[a-zA-Z0-9]{0,}" & lcase(adoRs.fields("Word")) & "[a-zA-Z0-9]{0,}"
		End If
Are my patterns wrong? I'm guessing they are.

Also, I don't know why, but it's not ignoring the case, even though I have set regex.IgnoreCase to true. Any thoughts?
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
general question about php and html timfoster PHP 3 05-17-04 12:29 PM
[PHP] Array question UmiSal Script Requests 1 04-05-04 01:52 PM
question and answer software jaydifox C/C++ 0 02-21-04 09:26 AM
question about updating a page or database for an, php and mysql updating mikewooten PHP 1 02-12-04 12:11 AM
Perl-PHP software Copyright question! kevin PHP 8 10-29-03 08:03 AM


All times are GMT -5. The time now is 04:22 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.