handle all regexp cases