Going from limited memory of the subject here, but try something like this:

[\w the|a|..........] (the 'the|a|......' part would be your preposition
list...)

I think the \w means you are looking for whole words.  Or it might be \W...

Hope that helps some...

Shawn Grover


-----Original Message-----
From: Jared Stark [mailto:[EMAIL PROTECTED]]
Sent: Friday, March 01, 2002 2:11 PM
To: CF-Talk
Subject: Regular Expression Help


Hello all.  I am trying to write a simple search engine, and would like
to replace certain commonly used prepositions from the search string
such as 'a','the','for', etc...

I have an array of the prepositions that I would like to remove, however
the problem I have is that it is removing them when they are subsets of
other words, for example 'them' would become 'm' when removing 'the',
'bag' would become 'bg' when removing 'a', etc...

I'm not an expert at regular expression, but I'm assuming it is possible
to remove only those instances where the prepositions are stand-alone
and not subsets of other words.  Could someone render me some
assistance?

Much thanks,
Jared


______________________________________________________________________
Why Share?
  Dedicated Win 2000 Server · PIII 800 / 256 MB RAM / 40 GB HD / 20 GB MO/XFER
  Instant Activation · $99/Month · Free Setup
  http://www.pennyhost.com/redirect.cfm?adcode=coldfusionc
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to