mirror of
https://github.com/nmap/nmap.git
synced 2026-08-04 14:49:29 +00:00
Fix DeprecationWarnings about string escapes in regex
This commit is contained in:
parent
2d4e45ead8
commit
4a41125fbc
2 changed files with 6 additions and 6 deletions
|
|
@ -780,11 +780,11 @@ class DateSubcriterion(Subcriterion):
|
|||
self.fuzzies = argument.count("~")
|
||||
argument = argument.replace("~", "")
|
||||
self.minus_notation = False
|
||||
if re.match("\d\d\d\d-\d\d-\d\d$", argument) is not None:
|
||||
if re.match(r"\d\d\d\d-\d\d-\d\d$", argument) is not None:
|
||||
year, month, day = argument.split("-")
|
||||
self.date = datetime.date(int(year), int(month), int(day))
|
||||
self.argument = argument
|
||||
elif re.match("[-|\+]\d+$", argument) is not None:
|
||||
elif re.match(r"[-|\+]\d+$", argument) is not None:
|
||||
# Convert the date from the "-n" notation into YYYY-MM-DD
|
||||
parsed_date = datetime.date.fromordinal(
|
||||
datetime.date.today().toordinal() + int(argument))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue