This pattern will work:
glob('/dir/somewhere/*.{?,??,[!z][!i][!p]*}', GLOB_BRACE);
which finds everything in /dir/somewhere/ ending in a dot followed by either
- one character (
?
)
- or two characters (
??
)
- or anything not starting with the consecutive letter z,i,p (
[!z][!i][!p]*
)