> Additionally: I'm not extremely surprised if other implementations mirror the details of the builtin glob as far as their behaviors go.
Tho I don't even know how to generate a test-suite for that.
It's mind-blowing
- alterations can be nested
- "nested" character classes do not exist but what are the exact escaping rules then?
- how do you test globing on filenames which a particular file-system doesn't allow °
- escaping of "glob-metas" must be reflected on "re-metas" and vice versa
- how do you test that no unintened re-meta was injected, without being escaped?
- I just noticed that Text::Glob translates {x,y} to (x|y) which means you get capture groups as a side effect.
There is more for sure ...
°) a quick test on Windows
DB<152> open my $fh ,">", "$_" or say "ERROR:'$_' $!" for qw/~ [ ]
+ { } * ?/
ERROR:'*' Invalid argument
ERROR:'?' Invalid argument
DB<153> x <?>
0 '['
1 ']'
2 '{'
3 '}'
4 '~'
DB<154>
see also this SO answer: what-characters-are-forbidden-in-windows-and-linux-directory-names |