Live data from Hacker News

Regex Crossword

regexcrossword.com

101–110 of 115 posts

Re: Regex Crossword

#101

What's wrong on beginner / 01? :D http://imgur.com/eJBJYSx

It's not mentioned explicitly, but the given patterns should match the entire answer, not just part of it. In your screenshot, "O+" means "one or more letters `O`" , it does not mention any `E` s, so OE is not a valid answer.

When you're testing your answers, add explicit start/end anchors and implicit grouping to get better results:

    var r = /^(?:HE|LL|O+)$/;
    console.log("OE".match(r));
    console.log("OO".match(r));

Re: Regex Crossword

#102

I really dislike that patterns using * wildcard required using the letters beforehand. The game requires A* to match a row with zero or more A's, but this is absolutely incorrect, as A* will gladly match ANY string, like QQQQ.

That isn't how the Kleene star works. A* is "the set of all strings over the alphabet {A}, including the empty string ε." "QQQQ" is not a string over the alphabet {A} because it contains the symbol 'Q', which is not in {A}.

I have no idea what you're talking about. My point is more pragmatic the regex /A/ will match the string "QQQQ" and this tool doesn't take that into account. E.g., I type this into my javascript console:

     /A*/.test('QQQQ');
     > true
Showing that yes, /A
/ does match 'QQQQ'

Re: Regex Crossword

#103
post #87

I really dislike that patterns using * wildcard required using the letters beforehand. The game requires A* to match a row with zero or more A's, but this is absolutely incorrect, as A* will gladly match ANY string, like QQQQ.

* is not a wildcard, it indicates that the preceding token occurs zero or more times.

Yes, that's exactly my point. By occuring zero times, it means the preceeding token is irrelevant, and will match any arbitrary string.

Re: Regex Crossword

#104
post #66

I really dislike that patterns using * wildcard required using the letters beforehand. The game requires A* to match a row with zero or more A's, but this is absolutely incorrect, as A* will gladly match ANY string, like QQQQ.

That's not an issue with A*. Every regex here has an implied anchor to the start and end of the string.

Fair enough, but implied anchors are not part of the regex standard

Re: Regex Crossword

#105

I really dislike that patterns using * wildcard required using the letters beforehand. The game requires A* to match a row with zero or more A's, but this is absolutely incorrect, as A* will gladly match ANY string, like QQQQ.

As I saw, the regexps are all implicitly anchored. When you read `A`, you need to be thinking `\AA\Z`.

Re: Regex Crossword

#106
post #100

What does it mean when a reg ex ends with a `\1` (backslash 1) as in this example third beginner puzzle? (.)+\1 http://regexcrossword.com/challenges/beginner/puzzles/3

Speaking of that puzzle how come [COBRA]+ and (.)+\1 give back result 'O'? Why not C or B or A?

(.)+\1 means the last letter has to be equal to the first letter.

(AB|O|OR)+ dictates that the last letter of the first row has to be A or O

[^ABRC]+ makes it so that the lower right square can't be B therefore the upper right square can't be A

Re: Regex Crossword

#108
post #21

How about you save my progress in a cookie? You might find this hard to believe, but I don't have a Facebook account.

Yeah same here. Clicked to a puzzle curious to play with it, saw the notice saying I need to log in to facebook, closed the tab.

Re: Regex Crossword

#109
post #21

How about you save my progress in a cookie? You might find this hard to believe, but I don't have a Facebook account.

Or, if you want to motivate this particular developer:

"How about you store my progress in a regex! (Which can be put into a browser cookie as an afterthought.)"

Re: Regex Crossword

#110
post #80
post #59

Earlier quoted context omitted.

Off topic, but god I just wish Facebook would disappear. It's ironic that such a popular company with such a huge valuation would produce an immediate and significant benefit to me if it just disappeared overnight.

It begs the question, do you mean Facebook the social network, or Facebook the company? Because there are surely many benefits coming from the company that don't necessarily depend on the social network.

It's hard to imagine one existing without the other
Post reply on HN