View Single Post
Old 12-09-2007, 04:51 PM   #6 (permalink)
Geert
The Contributor
RegEx Guru 
 
Join Date: Dec 2007
Location: Belgium
Posts: 60
Thanks: 6
Geert is on a distinguished road
Default

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
__________________
Kohana - PHP5 framework
Geert is offline  
Reply With Quote