I\'m trying to validate the string is matching the certain format. If it fails it should throw error. I\'m trying check whether the given string is matching the required for