Hacker News new | ask | show | jobs
by sundarurfriend 1340 days ago
Could do with a bit more instruction and feedback to the user. A lot of the times, the blue highlighting seems to indicate I've matched all the necessary parts of the input, which should mean the puzzle is solved, but it's Game Over instead.

My most recent examplew was "It's alive! It's alive!" as input with all the non-space underlined, for which I wrote `/\S/g`. It seemed to match all the required parts, but the timer just counted down and ended with a Game Over. And there's no feedback on what exactly was wrong. (I encountered similarly confusing ones seven or eight times, so this isn't an isolated input for which this happens.)

3 comments

> A lot of the times, the blue highlighting seems to indicate I've matched all the necessary parts of the input, which should mean the puzzle is solved, but it's Game Over instead.

You need to include punctuation for some regexes.

e.g.

   The brown fox.
             ^^^^
Would be matched with:

  /fox./
You have to be careful about escaping, in case you do not watch to match "foxy" as well.
If you are interested in Python regex, here's my tkinter app with 75 interactive exercises: https://github.com/learnbyexample/py_regular_expressions/tre...

This assumes you already know Python regex. If you'd like learn first, see my free ebook: https://learnbyexample.github.io/py_regular_expressions/

I've now made it clearer why /\S/g is different from /.*/

Try on the match start screen to see the different visual feedback between the two.