Re:Regex Golf
by dudus on Friday December 20, 2013 @11:42AM
(#6942271)
From: http://quaxio.com/triple/
[ Parent
| on HN ]
Re:Regex Golf
by raverbashing on Saturday December 21, 2013 @10:36AM
(#6946874)
The idea is as thus:
Remember division rules? If the sum of digits is divisible by 3, then the number is divisible by 3
So, if you have 0, 3, 6, 9, it's as you can remove them, the value won't change
Remaining are the 2, 3, etc digit numbers divisible by 3
Re:Regex Golf
by moron4hire on Friday December 20, 2013 @11:58AM
(#6942378)
569pts: ([^31]0|31|[017]2|[03]03|[^1]4|(900|01|7)5|6|[48]7|[57]8|09)$
Originally had 568, then saw this and improved. :)
580pts: 00(0$|3|6|9|12|15)|[^0]14|.53|^3[^38]|55|43|23|9.7
Nice. A smidge better at 582:
5[54]|2[437]|00($|[369]|1[25])|^8[17]|^3[29]|9.7One more smidgen, behold 584:
5[54]|2[437]|00($|[369]|1[25])|^[83][1729]|9.7586:
^[378][12479]|00($|[369]|1[25])|5[45]|2[347]