Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

regex2dfa

Project Description
regex2dfa
=========

[![Build Status](https://travis-ci.org/kpdyer/regex2dfa.svg?branch=master)](https://travis-ci.org/kpdyer/regex2dfa)

This is a command-line utility that converts a regular expression to a DFA.

* **input**: A perl-compatible regular expression, as defined by re2 [1].
* **output**: An AT&T DFA [2], which accepts an equivelent language to the input regular expression.

### References

* [1] https://code.google.com/p/re2/
* [2] https://openfst.org/

Building
--------

This utillity requires standard build tools: autoconf, make, gcc, etc.

Once you have your developement environment setup:

```
$ ./configure
$ make
$ ls bin/
regex2dfa
```

Example Usage
-------------

### Command-line

```
$ ./bin/regex2dfa -r "^(a|b)*$"
0 0 97 97
0 0 98 98
0
```

```
$ ./bin/regex2dfa -r "^(a|b)+$"
0 1 97 97
0 1 98 98
1 1 97 97
1 1 98 98
1
```

### C++ API

```C++
#include "regex2dfa.h"

...
std::string input_regex = "^(a|b)*$";
std::string minimized_dfa;
bool success = regex2dfa::Regex2Dfa(input_regex, &minimized_dfa);
std::cout << minimized_dfa << std::endl;
...
```

will output

```
0 0 97 97
0 0 98 98
0
```

Release History

Release History

This version
History Node

0.1.9

History Node

0.1.8.post2

History Node

0.1.7.post7

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
regex2dfa-0.1.9.tar.gz (1.3 MB) Copy SHA256 Checksum SHA256 Source Aug 22, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting