Skip to content

Commit

Permalink
Preprend regex string literals with an 'r' making them raw strings
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewanderson committed Oct 24, 2023
1 parent 335cb3a commit f7891ba
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions autodoist.py
Original file line number Diff line number Diff line change
Expand Up @@ -683,8 +683,8 @@ def remove_label(task, label, overview_task_ids, overview_task_labels):
def check_header(api, model):
header_all_in_level = False
unheader_all_in_level = False
regex_a = '(^[*]{2}\s*)(.*)'
regex_b = '(^\-\*\s*)(.*)'
regex_a = r'(^[*]{2}\s*)(.*)'
regex_b = r'(^\-\*\s*)(.*)'

try:
if isinstance(model, Task):
Expand Down Expand Up @@ -1366,7 +1366,7 @@ def autodoist_magic(args, api, connection):
# If start-date has not passed yet, remove label
try:
f1 = re.search(
'start=(\d{2}[-]\d{2}[-]\d{4})', task.content)
r'start=(\d{2}[-]\d{2}[-]\d{4})', task.content)
if f1:
start_date = f1.groups()[0]
start_date = datetime.strptime(
Expand All @@ -1389,7 +1389,7 @@ def autodoist_magic(args, api, connection):
if task.due is not None:
try:
f2 = re.search(
'start=due-(\d+)([dw])', task.content)
r'start=due-(\d+)([dw])', task.content)

if f2:
offset = f2.groups()[0]
Expand Down

0 comments on commit f7891ba

Please sign in to comment.