function to check the string is a date or a numeric or a string