Re: Bad Word Regex Help

2007-12-17 Thread Claude Schneegans
Normally I would just use boundaries (\b) for this, but since the current platform is running CF5 How about (non tested) reReplaceNoCase(attributes.replacedString, ([^a-zA-Z])#wordKey#([^a-zA-Z]), \1**CENSORED**\2, all) but be aware that any one really will to use badwords will just have

RE: Bad Word Regex Help

2007-12-17 Thread Mark Henderson
Hi Claude, Thanks for the help. How about (non tested) reReplaceNoCase(attributes.replacedString, ([^a-zA-Z])#wordKey#([^a-zA-Z]), \1**CENSORED**\2, all) I tried something similar earlier, and tested your suggestion just now:

Re: Bad Word Regex Help

2007-12-17 Thread Claude Schneegans
the above regex seems to be checking for any alpha characters either before or after the bad word It's the opposite: it is checking for one character which is NOT alpha, before AND after. The only thing I'm not sure is if it will match in the case of the beginning and the end of the string.

RE: Bad Word Regex Help

2007-12-17 Thread Mark Henderson
The only thing I'm not sure is if it will match in the case of the beginning and the end of the string. Better make sure, try : (^|[^a-zA-Z])#wordKey#([^a-zA-Z]|$) Awesome, thanks! Pardon my previous inept description, as I know the carrot means 'not'. Mark