5 ms·
That's not the case... .(C|HH)* matches with single character followed by any number of C's or HH's. So " " or "B" would work but in the puzzle the full line ha
by ladberg 6y ago
That's not the case... .(C|HH)* matches with single character followed by any number of C's or HH's. So " " or "B" would work but in the puzzle the full line has to match so those aren't possible
- freeopinion 6y agoCan you explain what you are seeing about "B" that does not match? Or about "_______"?
- ladberg 6y agoI agreed that "B" does match. However, the puzzle needs to match the full line and not just a substring so "ZZZZZZ" or "B " don't.
- freeopinion 6y agoYou have not explained how those are not matching the full line. I assert that they are. Show me actual correct code that says otherwise.
- chaorace 6y agoAs you can see[1], the regex checker is based on the JS RegExp.match method. Each cell is always 1 character long (so, either a letter of some kind or an empty space). The str parameter for the check function is assembled by concatenating these cells together[2], so the input string for an empty line will look something like this: "_______" Assuming an empty 7-cell row, the regex in question will match 7 times, once for each character. A result of multiple partial matches is not equivalent to getting just one perfect match, which is what the puzzle requires. Internally, the puzzle enforces this requirement by making each Regex rule require a full line match (see line 118: '^' + rule + '$'). Personally speaking, I felt like that was the most intuitive way to interpret the mechanics of the game, so I'm willing to give the programmer a pass when they slightly modify the regex rule prior to evaluation. [1]:https://github.com/Jimbly/regex-crossword/blob/8b178f32eba3799146fd5fdbe286e34d7cfe9e59/crossword.js#L116-L128 https://github.com/Jimbly/regex-crossword/blob/8b178f32eba37... [2]:https://i.imgur.com/PS0BmJ6.png https://i.imgur.com/PS0BmJ6.png
- anamexis 6y agoEven with the full line match, I can't figure this out. R?(CR)*MC[MA]* is not matching for the full line RMCMMMMMMMMM Why?
- ladberg 6y agoThat line matches for me if I add it to the grid, though it breaks other lines. Are you sure you're going the right direction? It should be going from the bottom left to the right (in the order of the the regex text).