Skip to main content

some algorithm implementations for automaton and regular expressions

Project description


This is a simple regular expression program. It implements NFA to DFA, DFA minimization and automaton visualization.

To enable plotting feature, you may need to install graphviz


from automaton_tools import DFA as MyDFA
myinput = "abc12.+qs{2,}(yui){1,2}?"
dfa = MyDFA.fromRegex(myinput)

# check whether the string matches the pattern from the beginning or not
ismatch = dfa.match("yuiyui")

# plot the transition graph
# it will generate dfa.png file

Known bug

It cannot handle . or \w properly. Because they are considered as a special kind of characters.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for automaton-tools, version 0.1.8
Filename, size File type Python version Upload date Hashes
Filename, size automaton_tools-0.1.8-py3-none-any.whl (18.4 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size automaton_tools-0.1.8.tar.gz (14.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page