<cfsavecontent variable="str">
*** 13/01/2003 09:47:06 TUser1 ***
callno:1126
Some comment1
*** 13/01/2003 08:30:27 TUser2 ***
Some Comment2
</cfsavecontent>
<cfscript>
regexp = "^\s*([*]{3}.+?[*]{3}.+?)\s*(?:[*]{3}.*)?$";
str2 = REReplace(str,regexp,"\1");
</cfscript>
<cfoutput><pre>#str2#</pre></cfoutput>
This returns the first comment with the datetime & user info. If you
want it without that info the regexp should be
"^\s*[*]{3}.+?[*]{3}(.+?)\s*(?:[*]{3}.*)?$"
Watch out for wrapping. There are no spaces in the regexp.
Pascal
> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: woensdag 31 maart 2004 16:55
> To: CF-Talk
> Subject: Re: help with string manipulation (Find,Replace)
>
> Hi Pascal, I'm really sorry for not getting back to you
> yesterday. I've been asked to work on something else.
>
> I'm trying to display the comment properly and need your
> help. I want to display the top most comment from the
> comments table. Here is an example. In the example below
> there are 2 comments
>
> *** 13/01/2003 09:47:06 TUser1 ***
> callno:1126
> Some comment1
>
> *** 13/01/2003 08:30:27 TUser2 ***
> Some Comment2
>
> I want to display the top most comment. In this case
>
> *** 13/01/2003 09:47:06 TUser1 ***
> callno:1126
> Some comment1
>
> All comments have the ***, date time and user information
> "*** 13/01/2003 09:47:06 TUser1 ***"
>
> I would really apprecaite your help.
> Best Regards,
> cfcoder
>
>
[Todays Threads]
[This Message]
[Subscription]
[Fast Unsubscribe]
[User Settings]
- Re: help with string manipulation (Find,Replace) Jas Panesar
- RE: help with string manipulation (Find,Replace) Pascal Peters
- RE: help with string manipulation (Find,Replace) Tangorre, Michael
- RE: help with string manipulation (Find,Replace) Pascal Peters
- RE: help with string manipulation (Find,Replace) Pascal Peters
- RE: help with string manipulation (Find,Replace) Pascal Peters
- Re: help with string manipulation (Find,Replace) Pascal Peters
- RE: help with string manipulation (Find,Replace) Pascal Peters
- RE: help with string manipulation (Find,Replace) Pascal Peters
- RE: help with string manipulation (Find,Replace) Pascal Peters