RE: Regex needed
Working on RSS right now. :) ... Ben Nadel www.bennadel.com -Original Message- From: Rey Bango [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 6:19 PM To: CF-Talk Subject: Re: Regex needed BTW Ben, you need to get an RSS feed on your blog so I can keep track of it. I was just reading some of the stuff you're doing on SEO. Very cool. Rey... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244370 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=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Regex needed
Sweet! Ben Nadel wrote: Working on RSS right now. :) ... Ben Nadel www.bennadel.com -Original Message- From: Rey Bango [mailto:[EMAIL PROTECTED] Sent: Tuesday, June 20, 2006 6:19 PM To: CF-Talk Subject: Re: Regex needed BTW Ben, you need to get an RSS feed on your blog so I can keep track of it. I was just reading some of the stuff you're doing on SEO. Very cool. Rey... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244371 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
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:244313 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
RE: Regex needed
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
Re: Regex needed
Looks like some of your data got clipped or removed (at least in gmail), but I'll take a stab at what you've got - while making some dangerous assumptions. Try: REReplaceNoCase ( data, '([^(]+)\([^)]+\)', '\1' ) On 6/20/06, Rey Bango [EMAIL PROTECTED] wrote: 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:244315 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
Re: Regex needed
Thanks gents! Worked like a charm! I have to get up to speed on regex. Its just so darn powerful. Rey... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244319 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=11502.10531.4 Donations Support: http://www.houseoffusion.com/tiny.cfm/54
Re: Regex needed
BTW Ben, you need to get an RSS feed on your blog so I can keep track of it. I was just reading some of the stuff you're doing on SEO. Very cool. Rey... ~| Message: http://www.houseoffusion.com/lists.cfm/link=i:4:244320 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