Check variables: move regexp to class, improve checks