thanks dain, this has made me realise i really need to know more about regular
expressions, as i could have another string that has now() instead of the
parenthesis:
<cfset str = '({name1}/365.25)*(datediff(now(),{name3}))' />
have played around with the expression you suggested to pick up anything
between the datediff() as then i can run the rematch from example above,
although my attempts have all failed so far...
>You could use something like this:
>
><cfset str = '({name1}/365.25)*(datediff({name2},{name3}))' />
>
><cfset match = reFindNoCase("datediff\({([^}]*)},{([^}]*)}\)", str, 1, true)
>/>
>
><cfset name2 = mid(str, match.pos[2], match.len[2]) />
><cfset name3 = mid(str, match.pos[3], match.len[3]) />
>
>HTH,
>-Dain
>
>
>
>>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:342470
Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm
Unsubscribe: http://www.houseoffusion.com/groups/cf-talk/unsubscribe.cfm