Hacker News new | ask | show | jobs
by jgrahamc 3268 days ago
Worth doing this by hand to exercise your knowledge of regular expressions. My solution (SPOILER): http://imgur.com/a/9iK9J
4 comments

Well done. I don't know what you think but I found that most of the time the character classes would intersect perfectly (i.e. there'd only be one character possible once you intersect both sides of a single square). That made it pretty easy overall since for the vast majority of the board you don't have to worry about the "context".

But I guess if it's meant for an audience of folks not very familiar with regexes it's difficult enough as it is.

I thought it was pretty easy given that the character classes meant that it was pretty easy to take a row/column and eliminate possibilities.
Well, thanks. I tried to cheat with https://github.com/blukat29/regex-crossword-solver and got hit with lex parsing errors! My limited python and 5 minute effort resulted in failure! At least I got to read the message though :-)
I'm assuming the solution isn't unique because I found some positions that are under-constrained.
I only found one column to have multiple solutions, and saved it for last, at which point only one option made sense.
Which positions? I didn't find any that were under-constrained.
Assuming 0 indexing: row 0 column 4. Constrained by rows 0, 2, 3 where rows 0 and 2 have [^XZVCHFJLQM] and [^\sPQFB] and row 3 has [OYSRU]. All of: O, Y, S, R and U match. Am I missing something?
In row 2, column 4 the (.) is reused via \1 in column 11 where it has to be R.
You did the same thing I did I imagine. The regexcrossword.com link has a small mistake:

[^PZVJG]{4}(.)[EFUG]{6}(.)[^\sPZVJI]{2}

should be

[^PZVJG]{4}(.)[EFUG]{6}\1[^\sPZVJI]{2}

(note the \1 )

Ah, but you have underscores where there should be spaces! ;)