Regular expression crossword solver
C# PowerShell JavaScript
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
MITMysteryHunt2013
RegexCrossword
.gitignore
LICENSE
README.md
blog.txt

README.md

regex-crossword

This is a C# program to solve a "regular expression crossword" by constraint propagation.

It includes a regular expression library which can enumerate possible matches to a regex given a constraint string. To save processing time, the possible matches are returned as a character set string (a minimal regex, in effect) rather than a list of strings directly:

var regex = new Regex("X*YX*");
var str = CharSetString.UnconstrainedStringOfLength(7);
Assert.IsTrue(regex.AddConstraints(str));
Assert.AreEqual("[XY][XY][XY][XY][XY][XY][XY]", str.ToString());

str = CharSetString.Parse("..Y....");
Assert.IsTrue(regex.AddConstraints(str));
Assert.AreEqual("XXYXXXX", str.ToString());

MIT Mystery Hunt 2013

This was inspired by the hexagonal regular expression crossword from the MIT Mystery Hunt 2013.

Watch this program solve the puzzle here.

The MIT Mystery Hunt 2013 web pages are at:

People blogged about this crossword at: