7 ms·
Show HN: The Typing of the RegEX
I'm sorry/not sorry for creating this.
- maxfurman 4y agoThis is fun! Except I was almost immediately stymied by a question that asked me to match both "like" and "live". I put in `/li[kv]e/`, which was not accepted, but passes in every regex engine on regex101. I'm a bit confused. Is this a bug in the game or did I miss something in the question?
- viggity 4y agoadd a "g" after the last slash to make it a global search. (I didn't make the game, I'm figuring shit out too. All the same, I'm a regex ninja and the time allotted is far too low.
- Natsu 4y agoIt doesn't seem to like regexes like /.*/ either, despite them matching the whole thing.
- deleted 4y ago[deleted]
- Apreche 4y agoThis would be a lot better if it didn't make me start and end every entry with / Also, the timer is way too short for anything more than a word or two. The third one is a whole bunch of words. That's too much.
- llagerlof 4y ago> Also, the timer is way too short for anything more than a word or two. The third one is a whole bunch of words. That's too much. Unless game objective is also to train typing, you are right.
- rashkov 4y agoI think that may be part of the inspiration, given the reference to "the typing of the dead" typing game
- llagerlof 4y agoI liked it. Thank you. These are my 2 cents: - The starting and ending / could be part of the mask, so the user don't need to type it. - Some rules are not immediately clear. Eg. "The WORLD IS GOOD", should be /WORLD IS GOOD/ or /(WORLD|IS|GOOD)/ ? Or both? - Add difficult levels. Maybe more time on easy mode. - It's a nice learning environment. Let the user try to solve the puzzle when the time ends, just don't let him pass to the next level. Or maybe let him pass, but reset the score.
- xnx 4y agoI think you need the trailing slash so you can add the global flag?
- llagerlof 4y agoYou are right! I thought the game doesn't support flags. Maybe just the starting / could be part of the mask.
- mcluck 4y agoI had fun with this but I _really_ wanted a learning mode. I was more interested in solving the puzzle of the regex than maxing out my score. Maybe make a version where you can get maximum points for a period of time then the possible points starts to go down. You can still continue after it hits 0, you just won't get any points
- personalityson 4y agoThey should state very clearly what RexEx version/engine
- pcthrowaway 4y agoIt's likely using your browser's javascript regex engine
- workeffortwaste 4y agoIt's using the built in .match() to parse your answers.
- johnmorrison 4y agoLoved this! Super fun, but the timer feels a bit fast sometimes and as far as I can tell the game will randomly give you anywhere from a very easy or quite difficult level at any point, so there doesn't feel to be a natural progression in difficulty as you start a new game and finish each level.
- luuuzeta 4y agoI tried it on my phone and it looks like it could be fun. However the timer is too fast.
- wodenokoto 4y agowhat are the / for? I couldn't figure out how to get started until I read someone in the comments suggest to make them optional.
- deleted 4y ago[deleted]
- WorldMaker 4y agoIt's a traditional Regex syntax in several languages including JS (relevant here), Perl, and going way back to ancient Unix tools such as vi and ed. The vi/ed form you often see in HN and other technical discussion memes too, such as: s/easy/hard Which is a joke to substitute uses of the word "easy" with "hard". The slashes mark a RegEx so you can get really clever in such jokes, though usually most such jokes are simple word substitutions.
- igor47 4y agowhat are exclusion puzzles? the underline changes to be an outline, but i'm really not sure what to do. some help on the game would be helpful!
- workeffortwaste 4y agoEvery word but the marked words, you can see an example of one being solved in this video. https://youtu.be/da0GyuwaY_Y https://youtu.be/da0GyuwaY_Y
- ykonstant 4y agoYou are pure, unadulterated eeeeeevil. Also, I am surprised at how many people are not getting the point of the game. Edit: by the way, the colors in the page are wonderful. The font is pretty nice, too.
- LordDragonfang 4y agoPerhaps enlighten us rubes with the "point"?
- sundarurfriend 4y agoCould 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.)
- asicsp 4y agoIf you are interested in Python regex, here's my tkinter app with 75 interactive exercises: https://github.com/learnbyexample/py_regular_expressions/tree/master/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/ https://learnbyexample.github.io/py_regular_expressions/
- demindiro 4y ago> 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./
- anamexis 4y agoYou have to be careful about escaping, in case you do not watch to match "foxy" as well.
- workeffortwaste 4y agoI'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.
- cphoover 4y agoneeds more clear instructions... Am I using capture groups? what is the goal?
- 1-more 4y agoIs this a bug? Matching both instance of "us!" in "One of us! One of us!" didn't work with either /us!/g or /\bus!/g. That said this rocks and I love it tysm.
- Sateeshm 4y agoThis is great. I would love it if it actually taught Regex for users that want to learn!
- uses 4y agoHow am I supposed to match two entirely different words? Atomic groups with | don't seem to work. Not something I'd use regex for anyway. What am I missing here?
- workeffortwaste 4y ago/wordone|wordtwo/g There's a video of it being played here: https://youtu.be/da0GyuwaY_Y https://youtu.be/da0GyuwaY_Y
- workeffortwaste 4y agoVideo of it being played: https://youtu.be/da0GyuwaY_Y https://youtu.be/da0GyuwaY_Y
- Cieric 4y agoNote for anyone who might have missed it like I did. Dark Reader makes the underlines not visible. Didn't know what I was doing at all until I disabled it.
- JulianChastain 4y agoIs there any way to see what the expected regex was after failure? I feel like this could be a great review tool if that was added
- whoibrar 4y agoYes. One or two potential answers could be really helpful features. It's too much to ask but I also wish to see recent submissions.
- mistersys 4y agoFun idea, but pretty unfun to play. Half the questions are just five, six different words you need to `|` together, and not enough time to even type out that many words. Feels like the author thinks regex is a useful way to match a bunch of unrelated words in a paragraph. Not really the point of regex.
- noxer 4y agoI guess the goal should be to find a common property like /\w{5,6}/g matches all 5 and 6 letter words but not longer or shorter words. But I agree the time is not a good measurement because typing speed is what limits most people.
- crazygringo 4y agoYeah I'm on mobile and can't see the text above while I type because of the space for the on screen keyboard and can't type fast enough anyways on mobile so just gave up instantly :)
- workeffortwaste 4y agoTrying to play it on mobile! Okay that's something I hadn't expected.
- satisfice 4y agoYou should have written: /I'm (sorry|not sorry) for creating this/
- SamLeBarbare 4y agohurry up! time based game over isn't a good idea. good typer's are advantaged insteed of that, distribute "try" token
- tambourine_man 4y agoDesign-wise this is amazing. Typography, animations, just great taste all in all.
- workeffortwaste 4y agoThank you.
- moritzwarhier 4y agoGreat visuals and sounds. I didn't understand the reference without the fellow HN commenter explaining it. Maybe you could focus the input box on startup and after Game over.
- ksherlock 4y agoOn older safaris, the background skewed svg doesn't display correctly (which would be a safari problem but there are plenty of ways to underline text without being too clever by half) so it's not clear what should be matched, particularly when it involves trailing punctuation.
- workeffortwaste 4y agoThanks for the heads up, I'll see what I can do.
- rvalue 4y agohave a untimed version too. also, typing // all the time is annoying, make it by default
- juancn 4y agoWhat syntax does it use? For example `|` doesn't seem to do anything.
- juancn 4y agoGot it, it looks like sed-ish syntax. In the end it's a typing speed test.
- workeffortwaste 4y agoIf you simply brute force by typing the words exactly puzzles you won't get the bonuses.
- orliesaurus 4y agoso frustrating you're not revealed the answer when you lose
- siraben 4y agoGot 8250. At some point it just becomes a matter of "how many words can you type separated by |", IMO. The design is very aesthetically pleasing, too.
- workeffortwaste 4y agoDoing that method disables the bonuses. Getting bonuses means more points and more time added to the clock.
- workeffortwaste 4y agoI've added match boundary markers now so it should be clearer why your RegEX might not be right. I've also enabled some of my debugging stuff in the console for those who want to dive deeper into expected outputs of certain puzzles.