Crosswords Help You Learn Regular Expressions

Regular expressions might seem arcane, but if you do any kind of software, they are a powerful hacker tool. Obviously, if you are writing software or using tools like grep, awk, sed, Perl, or just about any programming language, regular expressions can simplify many tasks. Even if you don’t need them directly, regular expression searches can help you analyze source code, search through net lists, or even analyze data captured from sensors.

If you’ve been using regular expressions for a long time, they aren’t very hard. But learning them for the first time can be tedious. Unless you try your hand at regular expression crosswords. The clues are regular expressions and the rows and columns all have to match the corresponding regular expressions.

For example, consider this puzzle (which is already filled out):


This puzzle has a theme (The Beatles). The first across clue says that the two characters have to be an HE or an LL or one or more Os (two, then, in this case). The first down clue says the characters can’t be S, P, E, A, or K. So even though the second across clue says the lower left cell could be an A (in PLEASE), that would violate the down clue.

Of course, this is a super simple puzzle, but the site has many more puzzles of increasing difficulty. If you prefer your puzzles in hardware, that’s ok. If you want to work a different kind of puzzle, you might look at our Omnibus.

18 thoughts on “Crosswords Help You Learn Regular Expressions

  1. Yep. Regex – lead balloons, they have a lot in common.

    Here’s the REGEX rules –
    1) Avoid Regex at all costs
    2) Tell people you know all about regex when you don’t
    3) Then you have to do that server side MOD_REWRITE, google it – someone else is sure to have done it before – then don’t tell anyone.
    4) Now you’ve mastered regex

      1. #1 is because 1 *have* learnt regex! Try to use Apache MOD_REWRITE without regex!!!

        It’s a pain to write efficient parsers (apart from MOD_REWRITE) and even then regex always comes with a significant performance cost.

        If you need to do something with regex then someone has probably done it before and they have probably made it as efficient as it can be so google it! and save yourself a lot of time.

        There are almost always alternatives to regex and they are almost always more efficient. In rare occasions you actually need regex.

        And then there is that readability issue that makes it the worst code in the world!!!!

        So tell me what very simple function this regex does …


  2. I think the real challenge and art to Regex is crafting them in such a way as to make your intentions clear to yourself and to others, especially after months or years have passed. If one is capable of doing this then I suspect they will instantly vanish in a flash of enlightenment and become an energy being of unlimited power.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.