makadev/re2dfa

Library for Regular Expression to DFA transformation.

Installs: 3

Dependents: 0

Suggesters: 0

Security: 0

Stars: 2

Watchers: 1

Forks: 0

Open Issues: 1

pkg:composer/makadev/re2dfa

0.1.0 2020-11-15 16:56 UTC

This package is auto-updated.

Last update: 2025-12-06 01:40:51 UTC


README

CI Testing

php-re2dfa

PHP Library for Regular Expression to DFA transformation.

What it is

A Library for transforming Regular Expressions (RegEx) into Nondeterministic Finitie Automaton with ɛ-transitions (ɛ-NFA) and Deterministic Finitie Automaton (DFA) with named final states for the purpose of analyzing and further use the constructed DFA / ɛ-NFA for example in visualizations or to build tokenizer.

What it's not

  • PCRE compatible
  • a fast Regular Expression matching alternative

Features

  • RegEx to ɛ-NFA transformation
  • direct ɛ-NFA construction
  • transform multiple ɛ-NFA with separate finitie states into a DFA
  • ɛ-NFA simulation
  • DFA simulation

planned Features

  • DFA minimization (f.e. Moore's partition algorithm)
  • DFA and ɛ-NFA output (f.e. dot, json, text)

internal TODOs

  • add usage examples for the features
  • optimizations here and there
  • replace stack oriented RegExParser with AST
    • character classes like whitespace (like :whitespace:)
    • repetition expression (like RE{min,max}, RE{exact})