Open vivekprm opened 2 years ago
E.g. "^register/?$" this should return false.
But ^register/?$
is a valid glob pattern, it matches ^register/x$
for example... It's also a valid regexp, and as a human I can see that it's likely intended as that and not a glob pattern, but I don't think this package can know that?
Thanks for your response!
I was looking at performance benchmark and it seems ^ and $ are not allowed in glob patterns?
So, my question is how glob.Compile is different from regexp.Compile ?
Regexps and glob patterns are different. I'm not sure why you think ^ and $ are not allowed - they are just normal characters as far as a glob pattern is concerned.
I'm not the author of this package, by the way, just a bystander.
I am trying to test whether a pattern is valid glob. How can we do that?
E.g. "^register/?$" this should return false.
I was trying to test like this but getting true.