>> >> my $exp = "nan|-?inf|[0-9\.e\+\-]+"; >> my $stat_pat = >> "(?:\\s+($exp))(?:\\s+($exp))" . # $1 number of samples, $2 minimum >> "(?:\\s+($exp))(?:\\s+($exp))" . # $3 maximum, $4 sum >> "(?:\\s+($exp))(?:\\s+($exp))" . # $5 average, $6 variance >> "(?:\\s+($exp))(?:\\s+($exp))"; # $7 skewness, $8 kurtosis > Why do you use ?: for all fields? > Are all fields optional? > If so, what would be present in the file if a field is blank? >
Hi Kapil, No, it doesn't mean optional. (?: ... ) is to group an expression, just like ( ... ) does, but it also avoids creating a backpointer, which makes it faster. JeeBee. ps > thanks for the answers you've all been providing :) -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/