Skip to content

Instantly share code, notes, and snippets.

@clux
Last active January 1, 2016 02:39
Show Gist options
  • Save clux/8080678 to your computer and use it in GitHub Desktop.
Save clux/8080678 to your computer and use it in GitHub Desktop.
regex golf - http://regex.alf.nu/
var r1 = /foo/ // 207
, r2 = /k$/ // 208
, r3 = /^[a-f]*$/ // 202
, r4 = /.(..).*\1/ // 201
, r5 = /^(?!.*(.)(.)\2\1)/ // 193
, r6 = /^(.)[^p].*\1$/ // 177
, r7 = /^(?!(xx+)\1+$)/ // 286
, r8 = /(.)(.\1){3}/ // 199
, r9 = /^.{5}[^e]?$/ // 199
, r10 = /^[378][12479]|00($|[369]|1[25])|55|2[347]/ // 589
, r11 = /ai|c$|^p|[bcnrw][bnopr]/ // 397
, r12 = /^(<(<(<(..)*>)*>)*>)*$/ // 288
, r13 = /^(?!(.(..)+)\1*$)/ // 93
;
// 3239 total
// https://gist.github.com/jonathanmorley/8058871 - for more
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment