Tags:
create new tag
view all tags

Ready for a regex challenge? Solve this puzzle!

2021-03-15 - 08:02:59 by PeterThoeny in Development
Regular expressions (regex for short) are powerful tools to analyze and manipulate text. They can be intimidating though. However, you can start small, and learn more as you keep using them. The Regular Expressions, To Match Or Not, That is the Question presentation is a good place to get started.
Coder on the verge of extinction
Image source: ComicStrip

How can you improve your regex skills? Here is a puzzle that will keep you busy for a while. When you solve this regex puzzle you may add a comment. However, shhh, don't give away the secret, only state the 8 letter word diagonally from the upper left to the lower right.

Table Regular Expression
^[AEGPQRT]+F[AEGPQRT]+$
^.*C.*S.*R.*$
^[AHOC]+TED.*$
^[CDEMOT]*$
^.*HOM.*$
^[^C]*C[^C]*[IOX]$
^.(M|O[XY]|TE)*$
^.*(.).*\1(.).*\2.*$
^(O|RHH|TT)*$
^[N-Z][A-M].*[CO][^CO]+[CO].*$
^[^J]*[^D]*OOO.*$
^.(MM|C)*$
^(.{4})\1$
^([^S]|SEE)*$
^Q*R*D*X*O*$
^[A-M].*X.X.X.*$

PS: I was quite actively answering regex questions on StackOverflow, where I had the idea for this regex puzzle. I created the puzzle on a Sunday afternoon, and posted it on StackOverflow. I started the post with: "This post is dedicated to the folks who tirelessly answer ^(?=.*simple)(?=.*advanced) regex questions on SO." However, I got downvotes and motions to delete the post, so I deleted it myself. I thought too stiff of an attitude. Hence I post the regex puzzle here on TWiki.org, so that it can spread some fun among developers.

Comments

.

Edit | Attach | Watch | Print version | History: r4 < r3 < r2 < r1 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r4 - 2021-03-22 - PeterThoeny
 

Twitter Facebook Digg Google Bookmarks E-mail LinkedIn Reddit    
  • Help
  • Learn about TWiki  
  • Download TWiki
This site is powered by the TWiki collaboration platform Powered by Perl Hosted by OICcam.com Ideas, requests, problems regarding TWiki? Send feedback. Ask community in the support forum.
Copyright © 1999-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.