in reply to tic-tac-toe regex golf
Then factor out the common leading dots and the trailing ..\4s to save another 6:^(...)*(\w)\2\2|^..(\w).\3.\3|(\w)..\4..\4|(\w)...\5...\5 #becomes ^(...)*(\w)\2\2|^..(\w).\3.\3|(\w)(..\4..\4|...\4...\4)
^(...)*(\w)\2\2|^..(\w).\3.\3|(\w)..(\4|.\4.)..\4
|
|---|