PS. The set of delivery methods would be in the first () separated by |

Ex: (Ground|Next Day Air|Fed Ex|Priority Mail).... 

Of course if you know that the price will always start with "{" and that is
the only thing, you might not even use a reg exp:

<cfset strMethod = Trim( ListFirst( "Ground {$7.95}", "}" ) ) /> 


.......................
Ben Nadel 
www.bennadel.com

-----Original Message-----
From: Ben Nadel [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, June 20, 2006 5:52 PM
To: CF-Talk
Subject: RE: Regex needed

If you know the set of delivery methods, you could try something simple
like:

<cfset strTest = "Ground {$7.95}" />

<cfoutput>
#REReplaceNoCase( strTest, "(Ground|FedEx) ?\{[^\}]+\}", "\1", "ONE" )#
</cfoutput>

This will match the whole string, and then replace it with only the Type:

Ground 


........................
Ben Nadel
www.bennadel.com

-----Original Message-----
From: Rey Bango [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 20, 2006 5:43 PM
To: CF-Talk
Subject: Regex needed

Would anyone be willing to help me with a regex expression?

I have the following data:

Ground

I need the regex expression to return only the word "Ground" and drop the "
($7.59)".

Help?

Rey...





~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244314
Archives: http://www.houseoffusion.com/cf_lists/threads.cfm/4
Subscription: http://www.houseoffusion.com/lists.cfm/link=s:4
Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Donations & Support: http://www.houseoffusion.com/tiny.cfm/54

Reply via email to