TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Show HN: RegEx Face Off – Beat your friends with regular expressions

70 点作者 impostervt超过 8 年前

18 条评论

netsec_burn超过 8 年前
Sorry, this will be a negative review. This is easily the most frustrating game I&#x27;ve ever played. I can&#x27;t test parenthesis because it tells me my time &#x27;ran out&#x27; with 45 seconds on the clock. I could barely type 4 or 5 characters.<p>Edit: There are also XSS issues with the player name, you can execute Javascript in the other player&#x27;s window. That&#x27;s not good. I confirmed this since an image I scripted to load via HTML (&lt;img src=) was visited by a Mac user. I use Linux.<p>POC player name:<p><pre><code> Rick&lt;audio style=&quot;width: 0px; height: 0px;&quot; controls autoplay&gt;&lt;source src=&quot;http:&#x2F;&#x2F;vignette3.wikia.nocookie.net&#x2F;rickroll&#x2F;images&#x2F;d&#x2F;d0&#x2F;Rick_Astley_-_Never_Gonna_Give_You_Up.ogg&#x2F;revision&#x2F;latest&quot; type=&quot;audio&#x2F;ogg&quot;&gt;&lt;&#x2F;audio&gt;</code></pre>
评论 #13290966 未加载
评论 #13292047 未加载
评论 #13290946 未加载
评论 #13291038 未加载
评论 #13291406 未加载
评论 #13293124 未加载
wwwigham超过 8 年前
My strategy of &quot;capture the last two characters of each input in the accept group followed by $&quot; hasn&#x27;t failed yet, and is quick to input and requires no thought. Though I wouldn&#x27;t say I&#x27;m practicing any practical RegEx skills doing so. :P
评论 #13291139 未加载
评论 #13290971 未加载
umbrai_nation超过 8 年前
There&#x27;s definitely a bug in the timing. I feel like it&#x27;s related to the previous round. Whenever I finished a round early, the next round timed out early.<p>Also, it should be revamped to always run the full time and award points to the shortest regex. I regularly won rounds with entries like `foo|bar|...` Easy to write, and requiring almost no skill.
wildmusings超过 8 年前
Is the game about regexes or finding letter patterns in words? The rounds I played aren&#x27;t realistic or particularly interesting uses of regexes.
swalsh超过 8 年前
This game would be better if it was like a pacman style cave with random letters or whatever, and you had to write a regex to get to the other side without running into an enemy
zzzcpan超过 8 年前
Some explanation of what to do and what flavor of &quot;regex&quot; syntax is accepted would be good. I&#x27;m guessing it&#x27;s a javascript syntax, but I don&#x27;t really remember how different it is from pcre, does it have lookahead&#x2F;lookbehind assertions and all that. Also cloudflare&#x27;s free ssl doesn&#x27;t work everywhere, letsencrypt is better at that and also free. Had to open the thing in chrome.
natch超过 8 年前
I know people have said this already, but just to update it, the site is still giving 5 second timeouts.<p>Also when you are playing as anonymous against anonymous, when it says: &quot;anonymous wins&quot; you don&#x27;t know which of the two anonymous players won. Even if the game says &quot;you won&quot; in the case where it was you, a new player doesn&#x27;t know that, so it still seems unclear. The anonymous players should be differentiated in some way.. a number tacked on, for example.<p>Also when the round finishes, it shouldn&#x27;t just show the regular expression for two seconds and then clear. It should show it for long enough to let me read it and think about it, with the data still displaying, and with a continue button I can click when ready.<p>Also sadly I think long term this site will have trouble attracting matching players. I expect it to only work during the peak of this exposure on HN. Great idea though.<p>Finally you should scale down the data so there is less of it to read. You can still make the challenges interesting with well chosen data. And you could add capture and substitution requirements. Again, great idea.
drej超过 8 年前
I&#x27;m a bit confused - I&#x27;m not sure I understand the practicality of this. I do like challenging regexps, but I did not find them here. I thought the point of code games is to practice a skill you could use in real life, but matching random bags of words while avoiding other random groups of words isn&#x27;t something one would use regexps for.<p>Apologies if I misunderstood the point of this.
logicallee超过 8 年前
Spoiler warning: super-strategy below.<p>Not a bad idea but since there&#x27;s no penalty for long strings I can win pretty much instantly by treating it as a typing test and typing a short (probably-unique) substring from each match separated by |. It&#x27;ll get me an instant-win but if for some reason it matches some non-matches I make it a little longer. Here&#x27;s a screen grab of me winning with this super-strategy. on this run for some reason you&#x27;ll notice there&#x27;s a bug at the end but normally it just lets me win with no chance for the other person to score. I&#x27;m not sure how you could address this... If you keep it this way it just becomes a typing test...<p><a href="http:&#x2F;&#x2F;tinypic.com&#x2F;player.php?v=jf88pe%3E&amp;s=9" rel="nofollow">http:&#x2F;&#x2F;tinypic.com&#x2F;player.php?v=jf88pe%3E&amp;s=9</a>
评论 #13291634 未加载
linusthebear超过 8 年前
Agreed, awesome idea, needs a few bug fixes. Perhaps a description of the game mechanics. Some patterns match inaccurately, and I am also experiencing running out of time with 30+ seconds on the clock, as well as not getting credit for correctly matching patterns. I had fun nonetheless.
nothrabannosir超过 8 年前
Nice idea! Unfortunately, here&#x27;s how to solve pretty much any game in &lt;3sec: firstword|secondword|thirdword|...<p>you can usually stop typing every word after ~3 chars (no other ones will match).
impostervt超过 8 年前
This is a little side project I made to learn about Web sockets. Each question consists of a &quot;match&quot; pattern and a &quot;skip&quot; pattern, and then looks up words on wordsapi.com to match those patterns when the question is generated.<p>It was hard thinking up patterns, so if you have ideas, please let me know.
评论 #13292453 未加载
评论 #13291176 未加载
评论 #13292786 未加载
readme超过 8 年前
Game&#x27;s fun but there&#x27;s a problem when sometimes the time runs out prematurely. If it didn&#x27;t do this I&#x27;d say 5 stars well done.
impostervt超过 8 年前
Maybe I need to add a &quot;I give up&quot; button to the question, and if each player hits it, move on to the next question.
bharatkhatri14超过 8 年前
Been ORing the first three characters of every to-match string. No one has beaten me in 15 games.
SnaKeZ超过 8 年前
Beautiful game but be care of cheaters, you can win just using DevTool (I tried and works well).
DvdGiessen超过 8 年前
Really cool, enjoyed playing it for a while. Challenges you to practise your regex golf[1] skills. :)<p>There seem to be some bugs with the timing mechanisms, probably some JS timeouts aren&#x27;t properly reset, causing weird game behaviour like running out of time mid-game (the countdown still displaying 10+ seconds). Also correct answers aren&#x27;t always acknowledged (all icons show the answer to be correct, however it doesn&#x27;t result in that player winning the game). :)<p>[1]: <a href="https:&#x2F;&#x2F;xkcd.com&#x2F;1313&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xkcd.com&#x2F;1313&#x2F;</a>
thealistra超过 8 年前
the app works to fast and I as a user get confused. It should show who won, with what match at the end of the round for a longer period of time