Oi! Forums! I capitalized that subject line for a reason!
Today's speculative question.
As a matter of routine, we tell people that
(jpg|JPG|jpeg|JPEG|gif|GIF|png|PNG)
can be collapsed to
(jpe?g|png|gif) [NC]
But does this really save server time?
jpe?g [NC] = JPG, jpg, JPEG and jpeg, sure.
But it also =
Jpg
jPg
jpG
JPg
JpG
jPG
:: pause here to whap self upside of head as I figure out there are 2^3 x 3 = 24 possibilities, not 2^3 x 2 = 16 ::
Jpeg
jPeg
jpEg
jpeG
JPeg
JpEg
JpeG
jPEg
jPeG
jpEG
JPEg
JPeG
JpEG
jPEG
This is fine if your graphics software went haywire and you really do have all those permutations. But otherwise you have to check for at least two options at each step--and you already know that one of those options will never apply. If j then never P; if J then never p. Isn't it faster to say "Once you're got the first letter, each subsequent test only has one possible match"? Does it take more time for the server to read those 10-15 extra bytes and parse a few more pipes?