\s* any number of whitespace (spaces, tabs, newlines,...)
( start group (for back reference)
[*]{3} three stars
.+? one or more characters (non greedy match: untill first
match of what comes next)
[*]{3} three stars
.+? one or more characters (non greedy match: untill first
match of what comes next)
) end group
\s* any number of whitespace (spaces, tabs, newlines,...)
(?:[*]{3}.*)? optional group not included in backreference: three stars
followed by any number of characters
$ end of string
\1 backreference to match for first group ([*]{3}.+?[*]{3}.+?)
Pascal
PS If you don't understand the difference between greedy and non greedy
matches, try doing the same on a string with 2 or more comments using .+
instead of .+?
> -----Original Message-----
> From: cf coder [mailto:[EMAIL PROTECTED]
> Sent: donderdag 1 april 2004 11:56
> To: CF-Talk
> Subject: Re: help with string manipulation (Find,Replace)
>
> 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
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

