Skip to content

Allow nested folders to be matched and parsed #7

@BigRoy

Description

@BigRoy

Goal

Implement a way to parse and list recursively where a single key can be matched to an arbitrary or predefined depth.

In a pattern like test/{nested}/foo allow both of the following to match:

paths = ['test/nest/one/two/foo',
         'test/one/foo']

Example

pather.ls("C:/test/{nested@nest(1, -1)}")

We'd need to decide on a way to define the allowed nesting depth within the pattern and keep it readable at the same time. In the above example I was thinking the @ symbol could be separator where everything behind it is read as a registered "resolver" method in pather returning an (additional?) regex pattern that must be matched.

This syntax could easily grow complex and is very specific so I'd be happy to see and discuss better alternatives.

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