in reply to help with []'s in regex please

since the [eE] means find zero or more e's or E's right?

Actually not quite. [Ee] means find exactly one e or E. [Ee]* means find zero or more, whereas [Ee]? means find either zero or one.

By the way, another trick you may find useful is case-insensitive matching. So actually you can just say:

return if ! (/\.jpe?g$/i );

Take a look at perlretut and Common Regex Gotchas.