James Coupe <ja...@zephyr.org.uk> wrote: >$ perl -e '("1" x $ARGV[0]) =~ m/^(1*)((??{$1x(length($1)-1)})$)(?(2)(?{print >length $1}))/' 4 >2 > >I don't recommend trying it on large numbers. 1024 was about as high as >my boredom threshold could tolerate on this box.
Oh, it gets better if I do something _sensible_ and make the (1*) non-greedy - so (1*?). Duh. -- James Coupe