-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
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
Labels
No labels