Ray,

I don't think there is any real difference. I am just grouping my
characters [_12]+ and noting that at least one item (+) is required for
the match. 

He is just listing them as being "OR"'d. 

Grouping [] inherently denotes OR. The | is an explicit OR. 

Also, if your example get's bigger, the | actually breaks the expression
up. For instnace, if you wanted to add outlier characters such as
getting rid of the above ONLY IF surronded by A and Z... 

My method would be:

A[_12]+Z

His method would be:

A(_|1|2)+Z 


It's all a matter of personal taste I suppose.

......................
Ben Nadel
Certified Advanced ColdFusion Developer
www.bennadel.com
 

-----Original Message-----
From: Ray Champagne [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, September 27, 2006 2:54 PM
To: CF-Talk
Subject: RE: regexp help

Ben, Claude, just so I know, what's the difference between your
solutions?
Is it merely more than one way to skin a cat, or is one better than
another?

> <cfset strTest = REReplace( strTest, "[_12]+", "", "ALL" ) />


> REreplace (MyString, "_|1|2", "", "all")




~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four 
times a year.
http://www.fusionauthority.com/quarterly

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:254489
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to