Skip to content

Provides a regular expression engine that uses a Nondeterministic finite automaton to simulate the regular expression

License

Notifications You must be signed in to change notification settings

Saphereye/gregex

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Gregex crates.io Build Passing

Gregex is a regular expression solver which utilizes Non-deterministic Finite Automata (NFA) to simulate the input strings.

Usage

extern crate gregex;
use gregex::*;
fn main() {
    let tree = concatenate!(production!(terminal('a')), terminal('b'), terminal('c'));
    let regex = regex(&tree);
    assert!(regex.simulate("abc"));
    assert!(!regex.simulate("a"));
    assert!(regex.simulate("aaabc"));
}

Theory

The project uses Glushkov's construction algorithm for creating the NFA.

The pipeline can be summarised as below

About

Provides a regular expression engine that uses a Nondeterministic finite automaton to simulate the regular expression

Topics

Resources

License

Stars

Watchers

Forks

Languages