Skip to content

prune inactive parts of marked regexp #19

@sebfisch

Description

@sebfisch

Currently, a regular expression is not altered during matching, except for shifting marks.

However, inactive parts that can never again become active do not influence the results of empty and final and can be dropped or replaced by noMatch or eps depending on whether they accept the empty word. Inactive parts may become active only if they have active parts to their left or if they are inside an active repetition.

Pruning may improve performance significantly for infinite regular expressions which do not use repetitions, and maybe even for large finite expressions such as (a?){n}a{n} for large n.

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