Skip to content

Instantly share code, notes, and snippets.

@junyuecao
Forked from jonathanmorley/regex_golf.md
Created January 10, 2014 04:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save junyuecao/8347168 to your computer and use it in GitHub Desktop.
Save junyuecao/8347168 to your computer and use it in GitHub Desktop.
Number Name Score Regex Length All match? Credit
 1 | Plain Strings| 207 | `foo`                                              | 3      | Yes        | 
 2 | Anchors      | 208 | `k$`                                               | 2      | Yes        |
 3 | Ranges       | 202 | `^[a-f]*$`                                         | 8      | Yes        |
 4 | Backrefs     | 201 | `(...).*\1`                                        | 9      | Yes        | gorhill (HN)
 5 | Abba         | 193 | `^(?!.*(.)(.)\2\1)`                                | 17     | Yes        | chingjun (HN) / josephlord (HN) 
 6 | A man, a plan| 177 | `^(.)[^p].*\1$`                                    | 13     | Yes        | hyp0 (HN)
 7 | Prime        | 286 | `^(?!(..+)\1+$)`                                   | 14     | Yes        | josephlord (HN)
 8 | Four         | 199 | `(.)(.\1){3}`                                      | 11     | Yes        | chrismorgan (HN) / MereInterest (HN)
 9 | Order        | 199 | `^.{5}[^e]?$`                                      | 11     | Yes        | ekke (HN)
10 | Triples      | 596 | <code>00($&#124;3&#124;6&#124;9&#124;12&#124;15)&#124;4.2&#124;.1.+4&#124;55&#124;.17</code>| 34 | Yes | alexandrosm (GH)
11 | Glob         | 397 | <code>ai&#124;c$&#124;^p&#124;[bcnrw][bnopr]</code>| 23     | Yes        | nwellnhof (HN)
12 | Balance      | 288 | `^(<(<(<(..)*>)*>)*>)*$`                           | 22     | No         | romanandreev (GH)
13 | Powers       | 93  | `^(?!(.(..)+)\1*$)`                                | 17     | Yes        | plby (GH)
14 | Long count   | 253 | `^((.+)0 \2+1 ?)*$`                                | 17     | Yes        | bbarry (GH)
15 | Long count v2| 253 | `^((.+)0 \2+1 ?)*$`                                | 17     | Yes        | bbarry (GH)
16 | Alphabetical | 317 | <code>.r.{32}r&#124;a.{10}te&#124;n.n..</code>     | 23     | Yes        | alexandrosm (GH)

Total Score: 4069

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment