reject nulls in validatePattern and validateFormat