This give me the value of 32

<cfset string="Department Summary by Employee 10/27/2010 - 10/27/2010">
<cfset dates=REFind("[0-1][0-9]/[0-3][0-9]/[0-9]{4}", string)>
<cfoutput>#dates#</cfoutput>



On Wed, Jan 26, 2011 at 1:54 PM, Ben Forta <[email protected]> wrote:

>
> Assuming that the dates are always in mm/dd/yyyy format, I'd use a regular
> expression, something like this:
>
> <cfset string="*Department Summary by Employee 10/27/2010 - 10/27/2010*">
> <cfset dates=REFind("[0-1][0-9]/[0-3][0-9]/[0-9]{4}", string)>
>
> <disclaimer>
> Code written on the fly with no testing ;-)
> </disclaimer>
>
> Dates will then be an array, and in your example dates[1] will be the start
> date and dates[2] the second date.
>
> --- Ben
>
>
> -----Original Message-----
> From: Monique Boea [mailto:[email protected]]
> Sent: Wednesday, January 26, 2011 1:42 PM
> To: cf-talk
> Subject: Extracting a date from a string
>
>
> Hello All.
>
> How would you go about extracting the date from this string:
>
> *Department Summary by Employee 10/27/2010 - 10/27/2010*
>
>
>
>
> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Order the Adobe Coldfusion Anthology now!
http://www.amazon.com/Adobe-Coldfusion-Anthology/dp/1430272155/?tag=houseoffusion
Archive: 
http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:341413
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm

Reply via email to