Skip to content

__findViewWithAttributeInTreeThatMatches should use search instead of match #330

Closed
@jrafaaael

Description

@jrafaaael

I'm trying something like client.findViewWithAttributeThatMatches(attr="text", regex=re.compile(fr"\babc\b")). however, if "abc" isn't at beggining of the text, the view doesn't match

Changing regex.match to regex.search fix the issue

if root and attr in root.map and regex.match(root.map[attr]):

It doesn't seem to break anything

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