Talk:1313: Regex Golf

Explain xkcd: It's 'cause you're dumb.
Revision as of 06:54, 6 January 2014 by 173.245.53.194 (talk)
Jump to: navigation, search

This is fairly simple fun little one.

Regex is sort for regular expressions. A regular expression is a series of characters that denotes a search criteria. For example, you could write a regular expression that would search for anything that looks like an address (a la comic 208).

Regex golf is a game in which you attempt to write a regular expression that will search through a list of items and bring back only those items that meet a certain criteria, but not anything else. The joke is that regular expressions are used to search text, but themselves are text strings. This means that you could write a regular expression that would look for another regular expression. You can then apply ad infinitum, and the universe implodes or something.

--Holshy (talk) 05:40, 6 January 2014 (UTC)

The last panel includes, of course, a regex "/(meta-)*regex golf/," which represents the phrase "regex golf" preceded by the phrase "meta-" up to infinite times.

As a punchline, it also refers to Jamie Zawinski's well-known quote about regex,

Some people, when confronted with a problem, think "I know, I'll use regular expressions." Now they have two problems.

Thus, the punchline is that the addition of meta layers to regex golf generates more problems for the programmer, but that was also the setup of the comic. So either the punchline is really weak—worth a chuckle if you got the above two references—or I missed the joke. 199.27.128.63 06:22, 6 January 2014 (UTC)

Could anybody comment on the first regex? Do I get it right that beyond others it will match all strings that contain a "b"? I can hardly believe that is not the case for any star trek subtitle... 173.245.53.194 06:54, 6 January 2014 (UTC)