Editing 1313: Regex Golf

Jump to: navigation, search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision Your text
Line 271: Line 271:
 
|}
 
|}
  
Randall's regular expression does ''not'' match presidential opponents Pinckney, King, Clay, Cass, Scott, Douglas, McClellan, Seymour, Greeley, Tilden, Hancock, Blaine, Bryan, Parker, Hughes, Cox, Davis, Smith, Landon, Willkie, Dewey, Stevenson, Goldwater, Humphrey, McGovern, Mondale, Dukakis, Dole, Gore, Kerry, McCain, or Romney.  However, it must be modified slightly, because it ''does'' match {{w|John C. Fremont|John C. Fremo<u>nt</u>}}, the runner-up to James Buchanan in 1856, as discussed by {{w|Peter Norvig}} at [http://nbviewer.ipython.org/url/norvig.com/ipython/xkcd1313.ipynb xkcd 1313: Regex Golf]. Note that Norvig provides a small amount of Python code which actually plays regex golf with arbitrary lists, and found a shorter solution than Randall's for the ''Star Wars'' vs ''Star Trek'' game (<code>/ t|p.*e/</code>).
+
Randall's regular expression does ''not'' match presidential opponents Pinckney, King, Clay, Cass, Scott, Douglas, McClellan, Seymour, Greeley, Tilden, Hancock, Blaine, Bryan, Parker, Hughes, Cox, Davis, Smith, Landon, Willkie, Dewey, Stevenson, Goldwater, Humphrey, McGovern, Mondale, Dukakis, Dole, Gore, Kerry, McCain, or Romney.  However, it must be modified slightly, because it ''does'' match {{w|John C. Fremont|John C. Fremo<u>nt</u>}}, the runner-up to James Buchanan in 1856, as discussed by {{w|Peter Norvig}} at [http://nbviewer.ipython.org/url/norvig.com/ipython/xkcd1313.ipynb xkcd 1313: Regex Golf]. It also matches {{w|Aaron Burr|Aaron <u>Bu</u>rr}}, the runner-up to Thomas Jefferson in 1800.  Note that Norvig provides a small amount of Python code which actually plays regex golf with arbitrary lists, and found a shorter solution than Randall's for the ''Star Wars'' vs ''Star Trek'' game (<code>/ t|p.*e/</code>).
  
 
==Trivia==
 
==Trivia==

Please note that all contributions to explain xkcd may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see explain xkcd:Copyrights for details). Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel | Editing help (opens in new window)