Added function that verify if a string is in the correct format.