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.

no-trivially-nested-lookaround can change the patterns #30

@RunDevelopment

Description

@RunDevelopment

Description

I just learned that capturing groups inside negated lookarounds behave interestingly. The captured text of a capturing group is reset after leaving a negated lookaround.

This means that the \1 in /(?!(a))\w\1/ is useless. However, the \1 in /(?!(?!(a)))\w\1/ (double negation) is useless too.

This means that (?!(?!R) for some regex R is equivalent to (?=R) if and only if R does not contain capturing groups.

The no-trivially-nested-lookaround does not account for this right now.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingruleIt's about new or existing ruleswontfixThis will not be worked on

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions