Skip to content

andrewevag/regexp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

regexp

A library for parsing regular expressions and matching with string by converting the regular expressions to DFAs.

Build

# Builds library libregexp.a 
> make

# Runs tests
> make test

Usage

Link with libregexp.a and include regexp.hpp in inc/

#include "regexp.hpp"
...

    Regexp* r = Regexp::parse("[a-zA-Z]+");	
    Dfa d = r->toNfae().toDfa();
    
    std::cout << d.match("hellopeople") << std::endl;    // Will print 1
    std::cout << d.match("hello123people") << std::endl; // Will print 0
    std::cout << d.match("hello\npeople") << std::endl;  // Will print 0

About

A C++ library for Regular Expressions

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published