TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Regex Puzzle

388 pointsby mbotoalmost 8 years ago

20 comments

bluesmoonalmost 8 years ago
Well, there is <a href="https:&#x2F;&#x2F;regexcrossword.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;regexcrossword.com&#x2F;</a>
评论 #14711112 未加载
评论 #14709974 未加载
bshimminalmost 8 years ago
Brilliant. My dad is 71, loves puzzles (like cryptic crosswords and Sudoku), is a huge technophobe, and has just retired. This should keep him busy until about 2022.
评论 #14710811 未加载
canada_dryalmost 8 years ago
Regex is one of those tools that I use a couple times a year - usually for cleaning up lousy input data.<p>I always end up spending a fair amount of time using tools like:<p><a href="http:&#x2F;&#x2F;regex.inginf.units.it&#x2F;" rel="nofollow">http:&#x2F;&#x2F;regex.inginf.units.it&#x2F;</a><p><a href="https:&#x2F;&#x2F;regex101.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;regex101.com&#x2F;</a><p><a href="http:&#x2F;&#x2F;www.regexr.com&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.regexr.com&#x2F;</a><p>And of course stackoverflow.
评论 #14710673 未加载
评论 #14710763 未加载
评论 #14712986 未加载
评论 #14714797 未加载
评论 #14710655 未加载
评论 #14711382 未加载
评论 #14711920 未加载
hokkosalmost 8 years ago
I&#x27;ve worked on the project where some XSD files defined fields with regex restrictions, also some rules over fields added other stricter regexps or negative regexps depending on some context in a format called Schematron. I had to generate XML files conforming to those XSD, so I used some tools around Z3 solver and Microsoft.Automata to generate those strings conforming to multiple regexps. It would convert the regexps to finite automaton and intersecting them, walking it from the starting state to a final one over a charset.<p>Links :<p><a href="https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;research&#x2F;publication&#x2F;symbolic-automata-the-toolkit&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;research&#x2F;publication&#x2F;symboli...</a><p><a href="https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;download&#x2F;details.aspx?id=52302" rel="nofollow">https:&#x2F;&#x2F;www.microsoft.com&#x2F;en-us&#x2F;download&#x2F;details.aspx?id=523...</a><p>It now seems to be Open Source (MIT):<p><a href="https:&#x2F;&#x2F;github.com&#x2F;AutomataDotNet&#x2F;Automata" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;AutomataDotNet&#x2F;Automata</a>
评论 #14713381 未加载
评论 #14710639 未加载
jgrahamcalmost 8 years ago
Worth doing this by hand to exercise your knowledge of regular expressions. My solution (SPOILER): <a href="http:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;9iK9J" rel="nofollow">http:&#x2F;&#x2F;imgur.com&#x2F;a&#x2F;9iK9J</a>
评论 #14710409 未加载
评论 #14710205 未加载
评论 #14711463 未加载
评论 #14711574 未加载
KineticLensmanalmost 8 years ago
This BBC report refers to a puzzle released by the UK&#x27;s National Cyber Security Centre [1], as part of an online recruitment effort.<p>[1] <a href="https:&#x2F;&#x2F;www.ncsc.gov.uk&#x2F;news&#x2F;take-our-regex-crossword-challenge" rel="nofollow">https:&#x2F;&#x2F;www.ncsc.gov.uk&#x2F;news&#x2F;take-our-regex-crossword-challe...</a>
评论 #14713268 未加载
评论 #14710476 未加载
Cephlinalmost 8 years ago
Wow, finally a crossword I have a chance at!
dbrgnalmost 8 years ago
If you want a challenge, try this one: <a href="http:&#x2F;&#x2F;twiki.org&#x2F;p&#x2F;pub&#x2F;Codev&#x2F;TWikiPresentation2013x03x07&#x2F;regex-crossword-puzzle.png" rel="nofollow">http:&#x2F;&#x2F;twiki.org&#x2F;p&#x2F;pub&#x2F;Codev&#x2F;TWikiPresentation2013x03x07&#x2F;reg...</a>
评论 #14711182 未加载
评论 #14711210 未加载
andyjohnson0almost 8 years ago
I know that there are problems to do with regex matching that are NP-hard. So I&#x27;m wondering if it is possible to attack this puzzle using an algorithm that simplifies the individual regexes using knowledge of the regexes that that they interact with?
评论 #14710723 未加载
评论 #14710366 未加载
评论 #14717289 未加载
评论 #14710217 未加载
mcbobbingtonalmost 8 years ago
I love regexes. In addition to doing cool things and saving time, I feel like I&#x27;m a &quot;real programmer&quot; whenever I write a good one.
评论 #14713219 未加载
Already__Takenalmost 8 years ago
Anyone know a decent android app for these? the MIT one has the most insane and broken scrolling functionality it&#x27;s shocking.
Xophmeisteralmost 8 years ago
That wasn&#x27;t as hard as I thought it would be. I was worried that, without stard&#x2F;end of string anchors, things could get quite hairy, but the biggest stretch of logic was just, &quot;There are five spaces for me to fit a character, an optional characters and two two-character sequences. Therefore that optional character must not appear.&quot;
Emyr42almost 8 years ago
Column H pattern starts [MVFU]{2}, and 3 of those options don&#x27;t match the Row 0 pattern, leaving &quot;U&quot;<p>The published solution says H0 should be &quot;S&quot;.
评论 #14752404 未加载
shabblealmost 8 years ago
Does any common regex format&#x2F;dialect require &#x27;\-&#x27; for a literal hyphen? AFAIK it&#x27;s only special inside character classes, and escaping it doesn&#x27;t necessarily work there if it would form a valid range identifier.
评论 #14711395 未加载
jwilkalmost 8 years ago
Direct link to the crossword:<p><a href="https:&#x2F;&#x2F;ichef.bbci.co.uk&#x2F;images&#x2F;ic&#x2F;976xn&#x2F;p057t19t.jpg" rel="nofollow">https:&#x2F;&#x2F;ichef.bbci.co.uk&#x2F;images&#x2F;ic&#x2F;976xn&#x2F;p057t19t.jpg</a>
ape4almost 8 years ago
Since the clues are machine parsable it should be machine solvable.
评论 #14710610 未加载
gumbyalmost 8 years ago
Nice! At Keplers in Mountain View you can buy version of Scrabble that uses regexes. The designer used to sell it in front of the shop -- he is obviously a programmer.
评论 #14711649 未加载
评论 #14712976 未加载
timdierksalmost 8 years ago
I believe column E is under-constrained; a solution with column E = &quot;YYYY &quot; or &quot;OOOO &quot; passes the tests, but is clearly not what&#x27;s intended.
评论 #14711689 未加载
评论 #14711533 未加载
IanCalalmost 8 years ago
Fun! I made a few mistakes by writing letters sideways which was then confusing (C vs U, for example), but this was a nice puzzle.
gozur88almost 8 years ago
That&#x27;s a very odd thing to see in a mainstream publication.