12-09-2007, 04:51 PM
|
#6 (permalink)
|
|
The Contributor
Join Date: Dec 2007
Location: Belgium
Posts: 60
Thanks: 6
|
The "jpg" and "jpeg" extensions can be merged into one alternation option, which should be faster.
Code:
/\.(jpe?g|png|gif|bmp)$/i
Also, since you're not using the captured parentheses, make them non-capturing, which should be faster.
Code:
/\.(?:jpe?g|png|gif|bmp)$/i
|
|
|
|