You oculd use something like

// make a pipe delimited list
regexwordlist = replace(wordlist, ",", "|", "all");

rereplacenocase(string, "(,)?( #wordlist#)(\.)?$", "");

Which will remove any word in the list, a preceding comma if it exists, and
a trailing period if it exists.  It will only remove something if it is
preceded by a space and is either the end of the string or is only followed
by the allowed period.

This has not been tested, and will likely require tweaking to do exactly
what you want, but it's a step in the right direction IMHO.

HTH.

As always, for more help, try:
http://www.houseoffusion.com/cf_lists/index.cfm?method=threads&forumid=21


--  Ben Doom
    Programmer & General Lackey
    Moonbow Software, Inc

: -----Original Message-----
: From: Thanh Nguyen [mailto:[EMAIL PROTECTED]
: Sent: Thursday, August 14, 2003 8:15 PM
: To: CF-Talk
: Subject: Regex help
:
:
: Can someone assist me in writing a regex to remove all common
: words such as
: inc., corp., llc., ltd. from a company name field.
:
: Thanks
:
: Thanh Nguyen
: 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/lists.cfm?link=t:4
Subscription: http://www.houseoffusion.com/lists.cfm?link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

This list and all House of Fusion resources hosted by CFHosting.com. The place for 
dependable ColdFusion Hosting.
http://www.cfhosting.com

Reply via email to