Skip to content

support filesystem like matching #2

@kortemik

Description

@kortemik

Description
support filesystem like matching. currently glb_01 supports matching whole strings such as

Glob glob = new Glob("**/path/to/*.txt");

which results to

^.*.*\Q/path/to/\E.*\Q.txt\E$

which then matches

/home/test/path/to/foo.txt
/home/user/path/to/biz.txt
/home/default/path/to/out.txt
/home/system/path/to/foo.txt
/home/grant/path/to/read.txt
/home/dba/path/to/bar.txt
/home/myrole/path/to/me.txt

however single star does match them too as resulting regex has .*.

Glob glob = new Glob("*/path/to/*.txt");

Use case or motivation behind the feature request
Current functionality does not match the functionality which a filesystem would do with a glob when run at system root / with single star */path/to/*.txt. This should not result into matches. However when in /home it should because path parts match.

Related issues

Additional context

Metadata

Metadata

Assignees

No one assigned

    Labels

    assistanceExtra attention, more information or help is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions