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 polynomial backtracking caused by the trivial concatenation of a subset with its superset #13

@RunDevelopment

Description

@RunDevelopment

Stuff like this:

/;+.*/ == /;.*/
/\d+\w+/ == /\d\w+/
/\w+\d+/ == /\w+\d/
/\w+\d*/ == /\w+/

More general: Let A be a subset of B.

/A{n,m}B{o,}/ == /A{n}B{o,}/
/B{n,}A{o,p}/ == /B{n,}A{o}/

The new rule should detect concatenation like this and report them. In trivial cases, it might even provide a fixer.

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