Live data from Hacker News

RegEx Crossword

jimbly.github.io

61–70 of 160 posts

Re: RegEx Crossword

#61
post #38

Earlier quoted context omitted.

Empty string does satisfy that. This puzzle gets it wrong.

That's because it's not empty string in the puzzle, it's 8 spaces. (and on top of that, we're doing a full match.)

R*D*M* should match empty string or a string of 8 spaces. or any combination of characters. It should be impossible not to match.

Edit: Fix HN oddity

Re: RegEx Crossword

#63
post #60

Earlier quoted context omitted.

8 spaces also matches. I don't know what you mean by a full match. Do you mean that you are using a different RegEx than the one displayed?

I assume by 'full match' they mean: - the pattern is found in the input - the start of the match is the start of the input - the end of the match is the end of the input By this definition, 8 spaces does not match the pattern.

I don't know what any of your three statements actually mean.

R*D*M* does not specify anything that has to be found in the string. Nor does any pattern of ()* or []* no matter what you put between the parens or brackets.

In all of those cases, any possible string matches the regex starting at the beginning of the string and ending at the end of the string.

Your clarification doesn't clarify anything for me.

Re: RegEx Crossword

#64
post #59

Earlier quoted context omitted.

.(C|HH)* should match against " " or against "A " or against "B" or against "ZZZZZZZ". But this puzzle doesn't recognize any of those as valid.

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

Can you explain what you are seeing about "B" that does not match? Or about "_______"?

Re: RegEx Crossword

#65
post #59

Earlier quoted context omitted.

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

Can you explain what you are seeing about "B" that does not match? Or about "_______"?

I 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.

Re: RegEx Crossword

#66
post #65

Earlier quoted context omitted.

Can you explain what you are seeing about "B" that does not match? Or about "_______"?

I 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.

You have not explained how those are not matching the full line. I assert that they are. Show me actual correct code that says otherwise.

Re: RegEx Crossword

#68
post #16

Is it supposed to have an unique solution or are multiple solutions possible?

The solution: https://www.i-programmer.info/images/stories/News/2014/Dec/B...

Aren't crosswords supposed to spell out a word? This feels like random characters. Unless i'm supposed to rotate it or something?

Re: RegEx Crossword

#69
post #38

Earlier quoted context omitted.

That's because it's not empty string in the puzzle, it's 8 spaces. (and on top of that, we're doing a full match.)

R*D*M* should match empty string or a string of 8 spaces. or any combination of characters. It should be impossible not to match. Edit: Fix HN oddity

[deleted]

Re: RegEx Crossword

#70
post #60

Earlier quoted context omitted.

I assume by 'full match' they mean: - the pattern is found in the input - the start of the match is the start of the input - the end of the match is the end of the input By this definition, 8 spaces does not match the pattern.

I don't know what any of your three statements actually mean. R*D*M* does not specify anything that has to be found in the string. Nor does any pattern of ()* or []* no matter what you put between the parens or brackets. In all of those cases, any possible string matches the regex starting at the beginning of the string and ending at the end of the string. Your clarification doesn't clarify anything for me.

[deleted]
Post reply on HN