Skip to content

Invalid regex generated when glob includes comma and character class #273

@pkaminski

Description

@pkaminski

The following call fails in minimatch 10.1.1:

> minimatch('foo', ',[[:space:]]')
SyntaxError: Invalid regular expression: /^\,[\p{Z}\t\r\n\v\f]$/u: Invalid escape

(The actual glob where I ran into this is more complex of course, and the comma usage therein makes more sense, but I figured a minimal repro would be better to report the issue.)

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