If you don't need the pipe symbol betwee the username and the date, then the following would do:

<cfcsript>
txt = query.column;
txt = replace( txt, "***", "<span"); // replace first ***
txt = replace( txt, "***", "</span>"); // replace second ***
cmStart = val( Find( "</span>", txt)+7 );
cmEnd = len(txt);
dspTxt = mid( txt, 1, cmStart);
cm = mid( txt, cmStart, cmEnd - cmStart);
</cfscript>

<cfoutput>#dsptxt#<br>
#cm#
</cfoutput>

Still, if you could replace your posting script to change it's format that would be the way to do it.  Either (ok) MAKE it post the list in the format you need it in, or (BEST) break the data into separate columns in your database.

> well I thought we regular expressions I can do some patter matching
> something to look for the first set of opening and closing 3 stars ***
> and replace everything inside/between the stars including the stars
> with
> <span class="time">User 1 | 14/4/2004 15:58:15</span>
>
> >I don't think his string has delimiters.
> >
> >-----Original Message-----
> >From: Dave Francis [mailto:[EMAIL PROTECTED]
> >Sent: Friday, May 14, 2004 10:34 AM
> >To: CF-Talk
> >Subject: Re: help with regular expressions!
> >
> >
> >Why regex rather than just Replace() or ListGetAt()?
> >  ----- Original Message -----
> >  From: cf coder
> >  To: CF-Talk
> >  Sent: Friday, May 14, 2004 11:15 AM
> >  Subject: help with regular expressions!
> >
> >  Hello Everybody,
> >  I've tried hard to find a solution to my problem but
> >  have had no luck.
> >
> >  I am pulling the data from the 'comments' column in a
> >  database table. The data in the comments column looks
> >  like this.
> >
> >  *** User1 10/28/2003 2:53:52 ***
> >
> >  THIS IS A TEST
> >
> >  *** User 2 04/06/2003  13:41:47 ***
> >
> >  blah, blah
> >
> >  I want to read everything that's between the *** ie
> >  *** User 1 10/28/2003 2:53:52 ***
> >  and display it like this:
> >  <span class="time">User 1 | 14/4/2004 15:58:15</span>
> >  THIS IS A TEST
> >
> >  Can somebody please show me how to do this using
> >  regular expressions?
> >  Many thanks
> >  cf coder
> >
> >  __________________________________
> >  Do you Yahoo!?
> >  SBC Yahoo! - Internet access at a great low price.
> >  http://promo.yahoo.com/sbc/
> >  
_____
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to