On Sat, 2002-03-02 at 10:10, Jared Stark wrote: > 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?
If you want to use regular expressions to do it, easiest way would be to use the character class for whitespace before and after your preposition. However don't underestimate the power of the CF list processing functions, think of your search term as a list seperated by whitespace and you can use any of the CF list functions. ______________________________________________________________________ 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

