move regexp to package level variable, add check for email array