-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Incorrect regex generated for patterns with ** #64
Comments
Docs state I see that the tests aren't matching descendants: Lines 93 to 122 in 6712c9c
|
# for free
to join this conversation on GitHub.
Already have an account?
# to comment
I'm trying to filter some paths, where I want to use **. Unfortunately, the regex that's getting computed internal to
Glob::filter()
seems to be incorrect.For example, the pattern
/**
compiles to~^/[^/]*[^/]*$~
. That will match/
,/foo
,/bar
, but not/foo/bar
. I believe it should be matching/foo/bar
.Similarly, the pattern
/foo/**
compiles to~^/foo/[^/]*[^/]*$~
. That will match/foo
,/foo/bar
, but not/foo/bar/baz
.So either there is a bug in the regex compiler in handling **, or I'm not understanding
**
properly. I suppose either is possible. If there is some other way I should be doing this, please advise. (In practice I think I only need prefix-matching, but was trying to use a full glob for it for flexibility.)The text was updated successfully, but these errors were encountered: