This regex will match stuff like myplugin.zip?someparameter=bla. Maybe you can use parse_url() and basename().