-
Notifications
You must be signed in to change notification settings - Fork 18
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
Request: Provide a constructor (like Regex( . . . )
vs r". . . "
)
#47
Comments
You can make either a FilenameMatch or GlobMatch object directly, since the macro is just a simple wrappers over calling one of those. Like regex (and other templates like printf, etc.), it can be sometime risky to generate them from code though instead of using literals, as you risk introducing meta-characters that causes them match more than you intended |
Thanks! I confirm that the following code works. using Glob
a = "hello"
#g = Glob.FilenameMatch("$(a).jpg")
g = Glob.GlobMatch("$(a).jpg")
@show g
for file in readdir(g)
println("Found $(file)")
end I observe that
Understood, but I don't quite know what your intention is. Is your point that one shouldn't use the |
I don't know that it needs to be exported, though it should at least be marked |
It would be nice if
Glob
provides a constructor that takes a regularString
and converts it to aGlob
.The motivation is the same as #27 ; that is, it would be nice if standard string manipulations are available, but my request draws an analogy with
Regex
:The text was updated successfully, but these errors were encountered: