> > What does  [^>]*? Mean exactly?  I seem to be using
> > something similar in my old code but can't remember
> > what it means.
> 
> [^>] means match any character other than >
> 
> * means match 0 or more of the previous expression, so in this case 0 or
> more of any character other than >
> 
> the ? after the * is probably unnecessary, but I've gotten in the habbit of
> it -- it makes a * or a + match a minimum number of characters necessary to
> match the previous expression, as opposed to the default greedy result... In
> this case it's probably just superfluous.
In CFMX (and in perl compliant RegEx engines) the use of a question mark (?) after a 
normal modifier such as an asterisk (*) means that the modifier will have a "minimal 
match". Normally, a RegEx portion will try to match everything that it can. If you 
specify minimal matching, it will only match as much as needed to satisfy the RegEx. 
If your using the pattern above alone, then it will match with nothing as that's the 
minimal match and there's nothing else specified in the RegEx.

> 
> 
> > I know perl regular expressions and this doesn't seem to
> > make sense. [^>] means expression starting with a > then * is a
> > modifier meaning zero or more and ? is a modifier meaning
> > 0 or 1 times.  I don't understand how that is legal regex.
> 
> I'm not sure aobut PERL, but in CF ^ is only start of string if it's at the
> beginning of the expression, so REFind("^...") will match the beginning of
> the string ... Starting a character grouping with ^ like this [^0-9] the ^
> becomes a "not" operator, so it's match all characters not in this group.
> 
> > Is CF regex that much
> > different then perl?
In 5, yes. In MX, not really. CF 5 uses a merger of the two Posix engines while CFMX 
uses the Jakata ORO engine. The ORO engine is basically Perl 5 compatible. There are a 
few caveats, but not many


______________________________________________________________________
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to