dilshod / xlsx2csv

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

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

Closed alexander-beedie closed 2 years ago

alexander-beedie commented 2 years 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!