Skip to content

More ways to anchor patterns #1476

Open
@g2p

Description

@g2p

I would like to use fixed-string patterns to match against a whole basename (something like find -name while disabling fnmatch or quoting metacharacters).

Right now, glob patterns are anchored to match the entire input (as determined by --full-path), and regex patterns aren't, and by adding * or ^$ it's easy to tweak them to get the desired anchoring. But with fixed-string patterns, there's no easy way to turn them into regexes or globs from a shell pipeline (one needs to call regex::escape with a matching crate version) to have patterns match start/end/whole input.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions