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.
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.