preg test and some common validation