added tests and regex validation