Census: Advanced

Census: Advanced Mercutio Thu, 2011-05-05 10:27

In this post we handled a simple census command with limited attribute values. But what if the attribute value is /not/ pre-defined.


&attribute player=value

And assume that one can only use letters, numbers or spaces

@attribute/limit attribute=^[a-zA-Z0-9 ]+$

And we wanted a census command that outputs:

value 1: player, player2, and player3
value 2: player6, and player 8
value 3: player5, and player7
value 4: player9

One way, /abusing/ named registers (which will fail after X amount of unique named registers have been used up - as defined in @config) - is to do the following:


[iter(%q,edit(%i0,_,%b): [itemize(%q<%i0>)],,%r)]

How would /you/ do this?