Skip to content

Instantly share code, notes, and snippets.

@adamschwartz
Last active December 31, 2015 23:59
Show Gist options
  • Save adamschwartz/8063395 to your computer and use it in GitHub Desktop.
Save adamschwartz/8063395 to your computer and use it in GitHub Desktop.
Regex Golf Answers http://regex.alf.nu
  1. Plain Strings (207): foo
  2. Anchors (208): k$
  3. Ranges (202): [a-f]{4}
  4. Backrefs (201): (...).*\1
  5. Abba (190): ^((?!(.)(.)\3\2).)*$ (Source)
  6. A man, a plan (177): ^(.)[^p].*\1$
  7. Prime (286): ^(?!(..+)\1+$)
  8. Four (199): (.)(.\1){3}
  9. Order (199): ^[^o]?.{5}$
  10. Triples (588): (00[039]|12|015|50)$|1..?4|4.2|1.7|6.0|006 (Source)
  11. Glob (366): \*(.+?)\*.+? .+?\1.+$|^(.+?)\*.+? \2|^(.+?) .+? \3$|vi
  12. Balance (286): ^(<(<(<(<(<(<<>>)*>)*>)*>)*>)*>)*$
  13. Powers (72): ^(xx?|xxxx|x{8}|x{16}|x{32}|(x{64})*)$

Total Score: 3181

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