John:x:/home/John:/bin/bash
is there a way to extract the field from above with colon separated. We have many users in the above format from /etc/passwd
John - username
x - passwd
/home/John - path
| rex "(?<username>[^:]+):(?<passwd>[^:]+):(?<path>[^:]+)"
How to deal with the empty fields between . Example there is empty field between passwd and after home directory
userid:passwd: :/home/John: :
| rex "(?<username>[^:]*):(?<passwd>[^:]*):(?<path>[^:]*)"
Thank you , let me check and update you !