Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow nested folders to be matched and parsed #7

Open
BigRoy opened this issue Nov 23, 2015 · 0 comments
Open

Allow nested folders to be matched and parsed #7

BigRoy opened this issue Nov 23, 2015 · 0 comments

Comments

@BigRoy
Copy link
Owner

BigRoy commented Nov 23, 2015

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant