is_date_format still gives wrong false positives
*Created originally on Bitbucket by [kound (Carli)](https://bitbucket.org/%7B4c69b10f-5001-445e-a563-b7e83e9bbb54%7D/)* As described in #124 is_date_format gives false positives. My custom format is: "Y: "0.00"m";"Y: "-0.00"m";"Y: <num>m";@ where m stands for meters (SI-Unit). As the given number 5334664.86 is to large, it will fail to load the sheet. So better to remove constants first: ``` #!python DATE_INDICATORS = 'dmyhs' COLORS = "(\[BLACK|BLUE|CYAN|GREEN|MAGENTA|RED|WHITE|YELLOW\])" BAD_DATE_RE = re.compile(r'(\[{0}\])|((?<=)#).*[dmhys]+.*#?'.format(COLORS), re.IGNORECASE + re.UNICODE) IGNORE_CONSTANTS = re.compile(r'"[^"]*"',re.UNICODE) def is_date_format(fmt): if fmt is None: return False fmt = fmt.lower() fmt = IGNORE_CONSTANTS.sub("",fmt) if any([x in fmt for x in DATE_INDICATORS]): return not BAD_DATE_RE.search(fmt) return False ``` (Sorry that I don't do a pull request - I am behind a restrictive firewall and can't user hg or git) *Attachments:* [minimal_defined_format.xlsx](/uploads/699fec79ace225f497fad54c5775b57b/minimal_defined_format.xlsx)
issue