[pcre-dev] [Bug 2107] Please add support for parsing glob(3)…

Páxina inicial
Borrar esta mensaxe
Autor: admin
Data:  
Para: pcre-dev
Asunto: [pcre-dev] [Bug 2107] Please add support for parsing glob(3) syntax
https://bugs.exim.org/show_bug.cgi?id=2107

--- Comment #2 from Ævar Arnfjörð Bjarmason <avarab@???> ---
(In reply to Philip Hazel from comment #1)
> I guess glob is quite easy: * becomes .* and ? becomes . and all other PCRE
> metacharacters get escaped and (?s) gets set (so . matches newlines). Is
> that it, or have I missed something?


That's pretty much it for the simple syntax, although the pattern needs
explicit ^ & $ anchoring. E.g. f* should match "foo" but "*oo" shouldn't match
"foo".

There's a lot more to modern glob syntax than that though. The Git test suite
has regression tests for wildmatch() & POSIX fnmatch(). This a list of:

     match <matches w/fnmatch?> <matches w/fnmatch?> <text> <pattern>


https://github.com/git/git/blob/v2.12.0/t/t3070-wildmatch.sh#L43

There's *, **, character classes etc.

--
You are receiving this mail because:
You are on the CC list for the bug.