Instead of parsing the output of "p4 users" use the python objects of "p4 -G users".