GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Don't create new substates for captures that aren't referenced by a backref · Issue #1 · travisdowns/polyregex

Don't create new substates for captures that aren't referenced by a backref #1

New issue
Copy link
New issue
Copy link
Open
Open
Don't create new substates for captures that aren't referenced by a backref#1
Copy link

Description

@travisdowns
travisdowns
opened on Apr 26, 2019
Issue body actions

In principle we only need to "record" (i.e., create new subNFA graphs) for captures that are actually used by some later backreference. I.e., in (.)(.)(.)\1\3 we currently record all three groups but only 1 and 3 are actually used. In principle it could be written with 2 as a non-capturing group like (.)(?:.)(.)\1\2 but we don't want to rely on the user for that.

Since number of unique backreferences is limited (to nine, i.e. \1 through \9), but the number of capture groups is unlimited, the behavior is important since if limited the captures based on found backreferences we can claim we are in P regardless of the regex.

This is as simple as scanning the regex after parsing and limiting the captures to those with at least one corresponding backreference.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.