# match (all are alphanumeric) /\A[[:alnum:]]+\z/ # doesn't match (any single is not alphanumeric) /[^[:alnum:]]/