GitXplorerGitXplorer
j

dr

public
1 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
8aa95457651837563eee79b437ad2d5134d17eda

typo

jjakebailey committed 8 years ago
Unverified
52e2e3f6f850dc232fad4ff29500a7133fb45509

performance improvements, unexport regex elements

jjakebailey committed 8 years ago
Unverified
2c12d9d7e0285fa47b3730dc66c827788af2c420

any rule

jjakebailey committed 8 years ago
Unverified
912a55f5ed1ce6c066194a65faba14a2b9f42fdb

performance increase

jjakebailey committed 8 years ago
Unverified
dd9dbbf277bbe399e48a9febabb3ed1990ae4590

benchmarks

jjakebailey committed 8 years ago
Unverified
a4d67c01cf0087e8b3873f0f57ef5fa012eb64a0

cmd output in readme

jjakebailey committed 8 years ago

README

The README file for this repository.

dr

ERE derivative-based regex engine

GoDoc

This is based on the derivative-based membership checking from CS 598 GR, aka Runtime Verification.

The implementation is relatively trivial (it's quite literally the same as the paper), so it might as well be public. The parser was the time consuming part.

"dr" comes from dR, i.e. derivative of R, because I think I'm funny.

The syntax uses ! for complement, * for the Kleene star, + for union, and . for any character.

The characters +*!\(). can be escaped by prefixing with a \.

The output of the test program in cmd/drtest is:

asdfg => asdfg
aaa+bbb => (aaa)+(bbb)
!(a)b*(cd)*e+f => (!(a)(b)*(cd)*e)+(f)
\+\++\*(\!\\) => (\+\+)+(\*\!\\)

matching against ab(c)*
: false
a: false
ab: true
abc: true
abccccc: true

Which shows the input and output after parsing and generating the regex, as well as various examples of matching a common expression.

In addition to those rules described in class, I've also added a rule for . (any), which accepts any single character, although, it could have been represented by (!a+a).