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

** Directory wildcard not matching correctly #13

Closed
dazinator opened this issue Dec 14, 2016 · 0 comments
Closed

** Directory wildcard not matching correctly #13

dazinator opened this issue Dec 14, 2016 · 0 comments
Assignees
Labels

Comments

@dazinator
Copy link
Owner

dazinator commented Dec 14, 2016

At the moment /**/some.* doesn't match /some.txt due to the fact that the / is matching, and then the directory wildcard ** is matching from position 1 with subtokens that match /some.* against text from position 1 which is some.txt. /some.* doesn't match some.txt.

This all boils down to the fact that ** token needs to also know if it has a trailing / so that I can omit a / token for the trailing slash in its place. That way rather than the glob /**/ being tokenised into

  • / token
  • ** token
  • / token

it can be tokenised into just:

  • / token
  • ** token (with information to say the token has a trailing / character.

This will result in the trailing slash in / being omitted as token, so then //some.* will match /some.txt.

/**/some.* will not however match some.txt as the first / still expects to match as it is a path separator token. I think this is ok, as to match "some.txt" in any directory you could use **/some.txt and then this wont require a leading slash.
.

@dazinator dazinator self-assigned this Dec 14, 2016
@dazinator dazinator added the bug label Dec 15, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant