Skip to content

Commit f10a7b6

Browse files
committed
faa_cs_aan.py: use r-strings for all regular expressions
Fixes this warning experienced with Python 3.12 (python/cpython#98401, python/cpython#99011): faa_cs_aan.py:690: SyntaxWarning: invalid escape sequence '\.' email_match = re.search('For Inquiries: ([0-9a-z._-]+@[0-9a-z.-]+)\.?$',
1 parent 867c274 commit f10a7b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

aviation/faa_cs_aan.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -687,7 +687,7 @@ def extract_text_from_cs_arrival_alert_notice(aan_pdf_page, *, allow_ocr=False):
687687
effective_from = None
688688
effective_to = None
689689

690-
email_match = re.search('For Inquiries: ([0-9a-z._-]+@[0-9a-z.-]+)\.?$',
690+
email_match = re.search(r'For Inquiries: ([0-9a-z._-]+@[0-9a-z.-]+)\.?$',
691691
text, re.IGNORECASE)
692692
if email_match is not None:
693693
email = email_match.group(1)
@@ -696,7 +696,7 @@ def extract_text_from_cs_arrival_alert_notice(aan_pdf_page, *, allow_ocr=False):
696696
email = None
697697

698698
disclaimers_match = re.search(
699-
'Not for navigation|For situational awareness', text, re.IGNORECASE)
699+
r'Not for navigation|For situational awareness', text, re.IGNORECASE)
700700
if disclaimers_match is not None:
701701
disclaimers = text[disclaimers_match.start():].split('\n')
702702
text = text[:disclaimers_match.start()].rstrip(' \n')

0 commit comments

Comments
 (0)