Check filename against pattern before loading as module