I just want to add my two cents and point out that the anti-.* attitude here theatens to install voodoo programming ideas in newcomers...
.* is often non-optimal, but it is very bad system of choosing which way to do it if you are using dogmatic rules.
Isn't the point of having many ways to do it the fact that the best way depends on context? Rather than encouraging bondage, I think it is healthier to encourage understanding of the cases where it causes problems.
In this case you're right that it would be more efficient to replace it, but not because .* is bad... simply because it's more work than is needed. On the bright side, since the regex is anchored the .* is a very small performance hit, not the order of magnitude that is caused by truely awful uses of it.
--
Snazzy tagline here
In reply to Re: Re: A question of efficiency
by Aighearach
in thread A question of efficiency
by c
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |