regexp golf

Posted on: Tue, 01/07/2014 - 23:54 By: Tom Swiss

Via xkcd.

Regex Golf

Type a regex in the box. You get ten points per correct match. Hit Enter to go to the next 'level'.

For the non-hackers in the audience, a regular expression, or regex (sometime regexp) is a technique of the programming arts used to specify a pattern against which we can check string of characters. For example, the regex /fo+(t|d)/ matches such strings as "fot", "foto", "food", "foo", "afoot", while not matching "ft" or "aft". Someone's made it into a game, and I'm kicking myself wondering how I never thought of that.