I dont know how to explain the issue but will share my code.  It should not check for regex if data is empty. Thanks