group_by vs. register for OS decision

Hello list,

I have a question concerning the group_by example on git

https://github.com/ansible/ansible-examples/blob/master/language_features/group_by.yml

I would like to see the register example too:

"


# Additionally, we can use the 'register' keyword in Ansible to set similar variables
# and use those for grouping.  This is not shown in this example.
"

But could not find any. I am trying to migrate a quite complex ansible setup from the old only_if stuff to when. 
My OS specific task decisions have been based on only_if until now, and I would prefer for now to go on with something similar like the when statement for OS decisions. 
I am still using playbook includes.

Thanks...

http://ansibleworks.com/docs/playbooks_best_practices.html#operating-system-and-distribution-variance