http://cstheory.stackexchange.com/questions/1854/is-finding-...
Regex Golf
171–180 of 189 posts
Re: Regex Golf
#172Earlier quoted context omitted.
Mine is a bit shorter, though a bit more "meh" as well. ^x{32}$|^(x{2}){1,8}$|^(x{64})+$|^x$
improved, gives 80 ^(x|(xx){1,9}|x{32}|(x{64})+)$
Re: Regex Golf
#173Re: Regex Golf
#174I got Four for 196 with (.).*\1.\1.*\1 and Order for 156 with ^a*b*c*d*e*f*g*h*i*j*k*l*m*n*o*p*q*r*s*t*u*v*w*x*y*z*$
Order for 198: ^[^o].....?$ Probably not what was wanted, but it works (or maybe it was to trick people onto a false path)
Re: Regex Golf
#175Fun learning tool for regex.
Practise, maybe. Learning, probably not so much. Certainly fun, though, if you can cope with them!
Re: Regex Golf
#176Re: Regex Golf
#177Does anybody know how to do math with regex? (triples) And conditionals don't seem to work?
From: http://quaxio.com/triple/ ^([0369]|[258][0369]*[147]|[147]([0369]|[147][0369]*[258])*[258]|[258][0369]*[258]([0369]|[147][0369]*[258])*[258]|[147]([0369]|[147][0369]*[258])*[147][0369]*[147]|[258][0369]*[258]([0369]|[147][0369]*[258])*[147][0369]*[147])*$
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