House of Fusion
Search over 2,500 ColdFusion resources here
  
Home of the ColdFusion Community

Mailing Lists
Home /  Groups /  ColdFusion Talk (CF-Talk)

ColdFusion 8 code in ColdFusion 7

  << Previous Post |  RSS |  Sort Oldest First |  Sort Latest First |  Subscribe to this Group Next >> 
Top  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Web Exp
12/31/2007 12:37 AM

Hi... I need help making this CF8 code work in CF7. Can anyone help me with this? Here's the code:     <cfset re1='.*?'>       <cfset re2='((?:[a-z][a-z\.\d]+)\.(?:[a-z\d]+))(?![\w\.])'>     <cfset re = #re1#&#re2#>     <!--- read the html file --->     <cffile action="read" file="#expandPath('homepage.html')#" variable="htmldoc">     <!--- return an array of image tags --->     <cfset images = REMatchNoCase("<img([^>]*[^/])>", htmldoc)>     <cfset files = arrayNew(1)>     <cfloop array="#images#" index="i">        <cfset imgpath = REMatchNoCase(re, i)>        <cfset imgpath = replace(imgpath[1],"""","","all")>   <cfset tmp = structNew()>         <cfset tmp.path = imgpath>         <cfset tmp.filename = listLast(imgpath,"/")>         <cfset tmp.fileExtension = right(imgpath,3)>         <cfset tmp.filetype = "image">         <cfset arrayAppend(files,tmp)>     </cfloop>     <cfdump var="#files#"> Thanks, K

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Charlie Griefer
12/31/2007 12:41 AM

how is it not working? On Dec 30, 2007 9:35 PM, Web Exp <webexp@gmail.com> wrote: ----- Excess quoted text cut - see Original Post for more -----

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Adrian Lynch
12/31/2007 02:05 AM

REMatch() is new to CF8, as is the array attribute in cfloop. Change the cfloop to an indexed loop and use http://www.cftagstore.com/tags/cfreextract.cfm or similar for the RegEx extraction. Adrian http://www.adrianlynch.co.uk/ Hi... I need help making this CF8 code work in CF7. Can anyone help me with this? Here's the code:     <cfset re1='.*?'>     <cfset re2='((?:[a-z][a-z\.\d]+)\.(?:[a-z\d]+))(?![\w\.])'>     <cfset re = #re1#&#re2#>     <!--- read the html file --->     <cffile action="read" file="#expandPath('homepage.html')#" variable="htmldoc">     <!--- return an array of image tags --->     <cfset images = REMatchNoCase("<img([^>]*[^/])>", htmldoc)>     <cfset files = arrayNew(1)>     <cfloop array="#images#" index="i">        <cfset imgpath = REMatchNoCase(re, i)>        <cfset imgpath = replace(imgpath[1],"""","","all")>   <cfset tmp = structNew()>         <cfset tmp.path = imgpath>         <cfset tmp.filename = listLast(imgpath,"/")>         <cfset tmp.fileExtension = right(imgpath,3)>         <cfset tmp.filetype = "image">         <cfset arrayAppend(files,tmp)>     </cfloop>     <cfdump var="#files#"> Thanks, K

Top  |   Parent  |   Reply  |   Original Post  |   RSS Feed  |   Subscribe to this Group
Author:
Raymond Camden
12/31/2007 11:15 AM

There are similar functions on CFLib. I believe reGetAll. On Dec 31, 2007 1:01 AM, Adrian Lynch <contact@adrianlynch.co.uk> wrote: ----- Excess quoted text cut - see Original Post for more ----- -- =========================================================================== Raymond Camden, Camden Media Email    : ray@camdenfamily.com Blog      : www.coldfusionjedi.com AOL IM : cfjedimaster Keep up to date with the community: http://www.coldfusionbloggers.org


<< Previous Thread Today's Threads Next Thread >>

Search cf-talk

May 24, 2012

<<   <   Today   >   >>
Su Mo Tu We Th Fr Sa
     1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31     

Designer, Developer and mobile workflow conference