Skip to content

Schema contains a regex pattern which fails to compile in some engines #341

@sirosen

Description

@sirosen

Initially reported downstream: python-jsonschema/check-jsonschema#577

This pattern reads as a range from \d to /:

"pattern": "^[a-z][a-z\\d-\/_]*$",

Maybe it works in some engines, but it definitely fails in Python. re.compile(r"^[a-z][a-z\\d-\/_]*$") gets an error:

re.error: bad character range d-\/ at position 12

I would tend to move - to the end of a character class so that it cannot be interpreted as a range. I'll submit a PR with that fix.

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