Skip to content
This repository was archived by the owner on Oct 11, 2021. It is now read-only.
This repository was archived by the owner on Oct 11, 2021. It is now read-only.

Detect non-disjoint alternatives #14

@RunDevelopment

Description

@RunDevelopment

To prevent exponential backtracking, the alternatives of a quantified group have to be disjoint (aside from the empty string and assertions).

For a RE /(A1|A2|...|An)*/, its alternatives have to disjoint such that:
∀ Aj: ( L(/(A1|...|Aj-1|Aj+1|An)*/) ∩ L(/Aj*/) ) \ {ε} = ∅ where L is a function which returns the language of the given RE and ε is the empty string.

This will be difficult to implement because we need to be able to construct an NFA from the RE and assertions don't make this any easier.

Metadata

Metadata

Assignees

No one assigned

    Labels

    new ruleruleIt's about new or existing rules

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions