dilshod / xlsx2csv

Convert xslx to csv, it is fast, and works for huge xlsx files
MIT License
1.64k stars 302 forks source link

Update regex string-literals to avoid "DeprecationWarning: invalid escape sequence" #240

Closed alexander-beedie closed 1 year ago

alexander-beedie commented 1 year ago

Depending on how your interpreter runs, the re.match calls can generate warnings like:

DeprecationWarning: invalid escape sequence '\d'
"""elif re.match("^\d+(\.\d+)?$", self.data) and re.match(".*[hsmdyY]", format_str) and not re.match("""

This PR just ensures the calls to re.match are also raw string literals (like the calls to re.sub). Thanks!