use a regular expression to get uid and gid

using regex removes the need for grep and awk and for the second
command since the regex can account for the whitespace in front
of 4 number uids.