Sweet! You are a genius! I can never get my head round regular expressions.
I don't have a clue what this is actually doing

regexp = "^\s*([*]{3}.+?[*]{3}.+?)\s*(?:[*]{3}.*)?$";
str2 = REReplace(str,regexp,"\1");

Can you kindly explain it to me because I have to explain it to my colleague and not look like a fool. Thanks Pascal

><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
>
>>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to