SIMPLE-AstroDB / SIMPLE-db

BSD 3-Clause "New" or "Revised" License
11 stars 21 forks source link

Update regex expressions #486

Open kelle opened 3 months ago

kelle commented 3 months ago

This bit of convert_spt_string_to_code is giving deprecation warnings: invalid escape sequence \d

 if re.search("\d*\.?\d+", spt[i + 1 :]) is None:
      spt_code = spt_code
 else:
      spt_code += float(re.findall("\d*\.?\d+", spt[i + 1 :])[0])

I think we just need to add r in front of the string.

https://stackoverflow.com/questions/52335970/how-to-fix-string-deprecationwarning-invalid-escape-sequence-in-python