Hi

I am creating an inktomi search using coldfusion, it is based around a set
of regular expressions...

What I am trying to do is identify whether a certain filetype is present and
then add an image where required (Pdf, word, etc)  I attempted a simple JS
routine, using indexOf, to identify this in the string, but it wouldn't have
it

Here is the strip of <Cfscript> which does the do, (probably won't help
much) :(

<cfscript>

// This function receives a block of plain text containing a search result
// and returns a marked up version.
//
// 2 URL
// 3 Title 
// 4 Score 
// 5 Size
// 6 Summary 

function render(input){
 var parsed=ArrayNew(1);
 var output="";
 var index=2;
 var st1 = REFind("URL: (.*)Title: (.*)Score: (.*)Size: (.*)Summary:
(.*)Date: ", input, 1, "TRUE");

 for ( ; index LTE ArrayLen(st1.pos); index = index + 1)
 {
         parsed[index]=Mid(input, st1.pos[index],st1.len[index]);
 }


 output=  "<li />" &      
          "<a href=""" & parsed[2] & """>" & parsed[3] & "</a><br />" & 
          "<strong>Summary:</strong> " & parsed[6] & "<br />" & 
          "<strong>Relevance:</strong> " & parsed[4] &"<br />" &
          "</li>";



return output;

}

</cfscript>

Basically I added a routine 

imageName=parsed[2] 
Return ImageName

Under the return output

However, when rendering it appears to completely ignore this statement
unless I add it above the output var...

If I do this, the output var is not rendered...

I'm rather new to regular expressions, but all the sorting is done with the
<cfscript>

Has anyone done this with Inktomi before?  If so , could I pilfer your
method?




Ashley M. Whiting
  Web development
  New Media Team
  Schools Communications Unit 
  Department for Education & Skills

  T: 020 7925 6535
  M: 07817 763972
  Alternate Email: [EMAIL PROTECTED]


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to