Skip to content

✨ Proposal: add regex lookbehind support (ES2018) #1591

@ryanblock

Description

@ryanblock

Describe the inspiration for your proposal

Authoring JSON Schemas that utilize regex patterns for properties where we do not want a string to end in a certain character (such as - or _); for this, negative lookbehinds are a highly useful tool.

Describe the proposal

As of today, while JSON Schema supports lookahead regex patterns, it does not appear to support lookbehinds. See:

Lookbehind was introduced in ES2018 and now enjoys broad support:

This seems like a natural addition!

Describe alternatives you've considered

No response

Additional context

Previously raised or mentioned in:

Metadata

Metadata

Assignees

No one assigned

    Labels

    proposalInitial discussion of a new idea. A project will be created once a proposal document is created.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions