Thank you pascal, the code works just the way I want it to. here it is:

<cfif Find('#Chr(13)#',qResults.Slug)>
  <cfset tmp=REReplaceNoCase(qResults.Slug,'^[^a-z0-9_]*([a-z0-9_])','\1')>
  <cfif Find('***',tmp) and trim(Left(tmp,Find('***',tmp)-1)) neq "">
    <cfset str = REReplace(qResults.Slug,"^\s*([*]{3}.*?[*]{3})?\s*","")>
    <cfset str = REReplace(str,"^(.*?)\s*[*]{3}.*$","\1")>
    #str#
  <cfelseif trim(Left(tmp,Find('#Chr(13)#',tmp))) neq "">
    #trim(Left(tmp,Find('#Chr(13)#',tmp)))#
  <cfelse>
   #tmp#
  </cfif>
</cfif>

I need your help with something else. This is not related to my original query, but related. When the comment field data is displayed in a text area, it looses the new line character. Don't know why. Here is an example.

MOVE FOLDER *** 04/06/2003  13:41:47 *** blah, blah *** 04/06/2003  2:33:5"

When I want display it like this:

MOVE FOLDER

*** 04/06/2003  13:41:47 ***

blah, blah

*** 04/06/2003  12:33:5"

Can you show me how to do this please.
Best Regards,
cfcoder

>On CFMX only
>
>// replaces whitespace and date/time before first comment
>str = REReplace(str,"^\s*([*]{3}.*?[*]{3})?\s*","");
>// Replaces everything starting from next ***
>str = REReplace(str,"^(.*?)\s*[*]{3}.*$","\1");
>
>NOT tested, I don't have CFMX running at the moment
>
>Pascal
>
>>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to