Skip to content

extglob and * #271

@cristipp

Description

@cristipp

There is a difference between foo* and @(foo)* in the generated regexp fragment for * . As a consequence, first glob matches the string foo, whereas the second does not. Is this intended behavior?

> console.log(new Minimatch('foo*').makeRe(), new Minimatch('foo*').match('foo'))
/^foo[^/]*?$/ true
> console.log(new Minimatch('@(foo)*').makeRe(), new Minimatch('@(foo)*').match('foo'))
/^(?:foo)[^/]+?$/ false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions