Just for sh*ts and giggles you could also use the underlying java split()
method.
<cfset string="Department Summary by Employee 10/27/2010 - 10/27/2010" />
<cfset ary_string = string.split(" ") />
<cfset firstDate = ary_string[5] />
<cfset lastDate = ary_string[7] />
On Wed, Jan 26, 2011 at 2:41 PM, Andrew Scott <[email protected]>wrote:
>
> That's the position it was found, the reFind if you read the docs also
> returns the position and length.
>
> Regards,
> Andrew Scott
> http://www.andyscott.id.au/
>
>
>
> > -----Original Message-----
> > From: Monique Boea [mailto:[email protected]]
> > Sent: Thursday, 27 January 2011 6:02 AM
> > To: cf-talk
> > Subject: Re: Extracting a date from a string
> >
> >
> > 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>
> >
> >
>
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:341436
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm