-
-
Notifications
You must be signed in to change notification settings - Fork 479
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
mismatching issue with when path contains '[***] #277
Comments
How about with back slashes like this:
That replaces I imagine that there are other edge cases that should be taken care of when your path might contain special characters, but I'm not sure about how to handle all cases off the top of my head. |
I was looking through the documentation just now and found a better solution to your problem, rather than escaping You should pass in the
|
@hhamilto I have a similar issue, except that the [ and ] character are part of the filename. I tried escaping with a backslash using your regexp, but it still doesn't work. Any ideas? |
confirmed as of today (version 7.1.3) that escaping square brackets (eg Also, as @sinedied noted, using the |
actually, as I was typing the previous comment, I came up with a devious hack: just wrap all square brackets with Eg if you want to match the path Ugly, but works, even as far back as package version 7.1.1 (that's as far back as I checked). This should be put in the ReadMe though because it's the only solution I've found so far. |
The pattern |
Hi, I encounter some issue with matching using glob :
I'm a currently using this pattern to find my mp3 file "path.join(currentdirPath,"/*.mp3") where currentdir change thanks to a parameters.
I noticed when currentdirpath contains "[somecharacter]" like in this exemple :
Senki Zesshou Symphogear Original Soundtrack 1 [mp3], glob found nothing.
but in this exemple : Senki Zesshou Symphogear Character Song 1 - Zwei Wing
glob found all the mp3 files
i think that's beacause [...] is a pattern, but how can I escape [ and ]
The text was updated successfully, but these errors were encountered: