http://qs321.pair.com?node_id=146164


in reply to Re: (Golf) Keysort
in thread (Golf) Keysort

Nice!

And you are correct with how im defining an integer.

However you are correct that there is a minor problem with the regex. The ignore leading whitespace shouldnt happen, as it prevents reconstructive methods from being successful. (Although ST style stuff should be fine with it...)

So the regex should be

/^(0|-?[1-9]\d{0,8})/
Your (?!\d) is a worthy and intelligent addition, but I was willing to overlook the issue it resolves. ;-)

BTW, my reasoning for disallowing 0000 and the like was to ensure that binary hash keys were sorted lexicographically.

Im going to update the original node with your score and the bit about the regex tomorrow.

Yves / DeMerphq
--
When to use Prototypes?