Skip to content

RichardBradley/regex-crossword

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

About

Regular expression crossword solver

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published