On Mon, Jul 14, 2003 at 09:19:01PM +1000, Paul Black wrote:
> First where can I find the CFML Tag Reference for CF 5.0 ? I'm using the
> refind tag.
The easiest way is to just use the included reference you got with the
coldfusion 5 install program. IIRC it installs it into /CFDOCS/
> I have a string which is composed out two parts, something like,
> "103,blue" A number followed by a colour and seperated by a comma.
> Following is the bit of CF 5.0 script which I'm working with:
>
> <cfset f2 = ReFind(",(*)", #attributes.id#, True)>
> <cfset number = Mid(#attributes.product_id#, 1, f2-1)>
> <cfset colour = Mid(#attributes.product_id#, f2+1, 10)>
>
> Now, what should my regular expression look like to find the position of
> the comma? I'm sure my first attempt above is wrong.
>
> My second question is what is the best way to find the length of the
> string following the "," ??
>
<CFSCRIPT>
myString = attributes.id;
i = REFind("([0-9]*),(.*)", myString, 1, TRUE);
if(i.pos[1] GT 0)
{
Number = Mid(myString, i.pos[2], i.len[2]);
Colour = Mid(myString, i.pos[3], i.len[3]);
}
</CFSCRIPT>
thats how you do tagging with CF5's re engine :/ not pretty but gets the job
done.
^_^
Jim
--
"Most moms teach their daughters how to run a house, but you? You teach
yours the fine art of mass destruction."
- Nabs - Goodbye is not forever
perl -le '$_="6110>374086;2064208213:90<307;55";tr[0->][ LEOR!AUBGNSTY];print'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=14
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=14
Signup for the Fusion Authority news alert and keep up with the latest news in
ColdFusion and related topics.
http://www.fusionauthority.com/signup.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.14