Brilliant. My dad is 71, loves puzzles (like cryptic crosswords and Sudoku), is a huge technophobe, and has just retired. This should keep him busy until about 2022.
Regex is one of those tools that I use a couple times a year - usually for cleaning up lousy input data.<p>I always end up spending a fair amount of time using tools like:<p><a href="http://regex.inginf.units.it/" rel="nofollow">http://regex.inginf.units.it/</a><p><a href="https://regex101.com/" rel="nofollow">https://regex101.com/</a><p><a href="http://www.regexr.com/" rel="nofollow">http://www.regexr.com/</a><p>And of course stackoverflow.
I've worked on the project where some XSD files defined fields with regex restrictions, also some rules over fields added other stricter regexps or negative regexps depending on some context in a format called Schematron. I had to generate XML files conforming to those XSD, so I used some tools around Z3 solver and Microsoft.Automata to generate those strings conforming to multiple regexps. It would convert the regexps to finite automaton and intersecting them, walking it from the starting state to a final one over a charset.<p>Links :<p><a href="https://www.microsoft.com/en-us/research/publication/symbolic-automata-the-toolkit/" rel="nofollow">https://www.microsoft.com/en-us/research/publication/symboli...</a><p><a href="https://www.microsoft.com/en-us/download/details.aspx?id=52302" rel="nofollow">https://www.microsoft.com/en-us/download/details.aspx?id=523...</a><p>It now seems to be Open Source (MIT):<p><a href="https://github.com/AutomataDotNet/Automata" rel="nofollow">https://github.com/AutomataDotNet/Automata</a>
Worth doing this by hand to exercise your knowledge of regular expressions. My solution (SPOILER): <a href="http://imgur.com/a/9iK9J" rel="nofollow">http://imgur.com/a/9iK9J</a>
This BBC report refers to a puzzle released by the UK's National Cyber Security Centre [1], as part of an online recruitment effort.<p>[1] <a href="https://www.ncsc.gov.uk/news/take-our-regex-crossword-challenge" rel="nofollow">https://www.ncsc.gov.uk/news/take-our-regex-crossword-challe...</a>
If you want a challenge, try this one: <a href="http://twiki.org/p/pub/Codev/TWikiPresentation2013x03x07/regex-crossword-puzzle.png" rel="nofollow">http://twiki.org/p/pub/Codev/TWikiPresentation2013x03x07/reg...</a>
I know that there are problems to do with regex matching that are NP-hard. So I'm wondering if it is possible to attack this puzzle using an algorithm that simplifies the individual regexes using knowledge of the regexes that that they interact with?
That wasn't as hard as I thought it would be. I was worried that, without stard/end of string anchors, things could get quite hairy, but the biggest stretch of logic was just, "There are five spaces for me to fit a character, an optional characters and two two-character sequences. Therefore that optional character must not appear."
Column H pattern starts [MVFU]{2}, and 3 of those options don't match the Row 0 pattern, leaving "U"<p>The published solution says H0 should be "S".
Does any common regex format/dialect require '\-' for a literal hyphen? AFAIK it's only special inside character classes, and escaping it doesn't necessarily work there if it would form a valid range identifier.
Direct link to the crossword:<p><a href="https://ichef.bbci.co.uk/images/ic/976xn/p057t19t.jpg" rel="nofollow">https://ichef.bbci.co.uk/images/ic/976xn/p057t19t.jpg</a>
Nice! At Keplers in Mountain View you can buy version of Scrabble that uses regexes. The designer used to sell it in front of the shop -- he is obviously a programmer.
I believe column E is under-constrained; a solution with column E = "YYYY " or "OOOO " passes the tests, but is clearly not what's intended.