News for hackers. Stuff that matters.
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by netsec_burn on Saturday December 31, 2016 @08:21AM (#13290898)
Sorry, this will be a negative review. This is easily the most frustrating game I've ever played. I can't test parenthesis because it tells me my time 'ran out' with 45 seconds on the clock. I could barely type 4 or 5 characters.

Edit: There are also XSS issues with the player name, you can execute Javascript in the other player's window. That's not good. I confirmed this since an image I scripted to load via HTML (<img src=) was visited by a Mac user. I use Linux.

POC player name:

  Rick<audio style="width: 0px; height: 0px;" controls autoplay><source src="http://vignette3.wikia.nocookie.net/rickroll/images/d/d0/Rick_Astley_-_Never_Gonna_Give_You_Up.ogg/revision/latest" type="audio/ogg"></audio>
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by StavrosK on Saturday December 31, 2016 @08:43AM (#13290966)
I gave up after 2-3 games as well. Time kept running out in three seconds. The semantics are also murky, what do I need to match? The regex doesn't assume ^$, but then do I need to match all intermediate characters? Or just some of them? Or what?

Also, the UI is bad, there's a "match" column with a tick and an x, and you get the tick when you match good regexes and the x when you match bad ones. However, why is the column called "match", then? It should have the tick when a regex matches and the x when it doesn't.

Great idea, very frustrating execution.

Re:Show HN: RegEx Face Off – Beat your friends with regular ... by jodrellblank on Saturday December 31, 2016 @11:50AM (#13291778)
You need to write a regex which matches the ones that say "match" by them and excludes the others.

The column with the tick and cross are whether your regex puts this entry in the correct group or not.

"match" and your regex matches it -> tick. exclude and your regex excludes it -> also tick. Successful test.

"match" and you don't match it, exclude and you do match it -> cross, failing test.

Re:Show HN: RegEx Face Off – Beat your friends with regular ... by StavrosK on Saturday December 31, 2016 @12:20PM (#13291953)
It looks like you just need to match anything in the line, not the whole line. Basically, re.search(your_regex, line) should not return None.

The ticks are just bad UX, because "tick" means pass, "x" means fail and blank also means fail. I know which ones I shouldn't match, just give me a tick on ones that match, good or bad, and I'll figure out the rest.

Re:Show HN: RegEx Face Off – Beat your friends with regular ... by ufmace on Saturday December 31, 2016 @12:36PM (#13292047)
I got the 5 second timeouts too. Not sure about the viability of the whole game concept. I kinda like the other idea in this thread of giving both players a fixed amount of time, minute or 2, and whoever comes up with the shortest regex that solves it wins. Then you could probably populate it with random words, and let people skip ones they didn't think they could solve. You'd probably get some interesting solutions that way.
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by impostervt on Saturday December 31, 2016 @08:39AM (#13290946)
Totally valid, sorry about that. Looks like I'm not clearing some js timeouts.
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by impostervt on Saturday December 31, 2016 @09:02AM (#13291038)
The Rickroll should be fixed.
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by netsec_burn on Saturday December 31, 2016 @09:23AM (#13291108)
Still there actually, but in a different place. There's another XSS, if you just paste this in your solution:

  |<audio style="width: 0px; height: 0px;" controls autoplay><source src="http://vignette3.wikia.nocookie.net/rickroll/images/d/d0/Rick_Astley_-_Never_Gonna_Give_You_Up.ogg/revision/latest" type="audio/ogg"></audio>
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by impostervt on Saturday December 31, 2016 @09:35AM (#13291169)
Ok, now THAT rick roll should be fixed
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by netsec_burn on Saturday December 31, 2016 @09:06AM (#13291056)
Nice, thanks for being responsive! I agree it's a great concept, sorry if the critique came across as harsh.
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by impostervt on Saturday December 31, 2016 @09:08AM (#13291063)
Np, glad someone's playing it. I was loling when I started a game and rickroll started playing.
Re:Show HN: RegEx Face Off – Beat your friends with regular ... by ElijahLynn on Saturday December 31, 2016 @04:02PM (#13293124)
Yeah, the "time ran out" prematurely bug killed it for me.