Skip to content

re.match(a, (b or c)) does not work #1

Description

@behinger

I have a problem with this line:

if re.match(payee, (entry.payee or entry.narration)):

I don't think it works the way you intended it. Not a python pro, but in my small test, python just ignores the parantheses.

import re
a = r"^\d"
b = "nope"
c = "1"
print(re.match(a,(b or c)))

This returns None, whereas I expected it to return True

I replaced the or with a + because I want to match both anyway :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions