Skip to content

QUESTION: How to match dot files and dot directories #30

@bpj

Description

@bpj

I'm having trouble formulating a rule which includes/excludes "dot files" and "dot directories" without false positives. I've tried with

$rule->new->not( sub { m{ (?: \A | / ) \. (?! \z | [/.\s] ) }x });

but it seems not to be entirely successful. Note that I need to formulate it so that various names ot downloaded files and files obtained from clients with non-ASCII characters, whitespace and dots in funny places don't get matched. I wondered if there was a pre-defined rule for this so I grepped the documentation for "dot" and "hidden" but came up empty-handed. I guess that the lack of such a predefined rule may be an indication that this is a known difficulty.

Also it seems that when I use skip_vcs together with the above .git paths do slip through, which is very weird!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions