QuackFuzed.com is the personal ColdFusion coding blog of Matt Quackenbush. It exists primarily as a place for the author to learn, and hopefully to assist others in learning and/or avoiding some of the same pitfalls and mistakes. (Quack certainly makes enough mistakes daily to make up for the entire ColdFusion community.)

Method Composition Works Externally But Not Internally - reEscape(), reUnescape(), and reEscape2()

Posted on December 1, 2007 at 6:30 PM in General, ColdFusion

What is reEscape()?

Often times, when you pass a string through ColdFusion's built-in regular expression (regEx) functions [reFind()/reFindNoCase()/reReplace()/reReplaceNoCase()], the string needs to have regEx special characters escaped. reEscape() is a tidy little method that I wrote to do just that.

So, let's see reEscape() in action, and point out its good and its bad.

[Continue Reading]

Comments
(Comment Moderation is enabled. Your comment will not appear until approved.)

On 12/1/07 at 10:06 PM, Sean Corfield said:

I guess you'll be updating this post now you have it working, eh? :)

BTW, method chaining is foo().bar().wibble() - what you are doing is typically called method composition foo( bar( wibble() ) )

On 12/2/07 at 3:05 PM, Matt Quackenbush said:

@sean - update made. Thank you again for your help and tips. Also, thank you for pointing out my misuse of the term "method chaining". I have updated the title to reflect the correct term of "method composition".
CodeBassRadio

Latest Articles

Eventually something really brilliant and witty will appear right here.

Calendar

December 2007
S M T W T F S
« Nov   Jan »
            1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31          

Subscribe

Enter a valid email address.

The Obligatory Wish List