Don't bother trying to parse it. POSIX requires that
id support various options to do this automatically:
printf "Login: %s\nId: %s\nGroup: %s\n" "$(id -un)" "$(id -u)" "$(id -gn)"
In addition to being more work, parsing is complicated by the fact that
id with no options is permitted to produce locale-dependent output:
The following formats shall be used when the LC_MESSAGES locale category specifies the POSIX locale. In other locales, the strings uid, gid, euid, egid, and groups may be replaced with more appropriate strings corresponding to the locale.
While most reasonable parsing tools can cope with this, anything that isn't Unicode-aware may have problems.