Looking for regex to extract email addresses from /etc/passwd
- by Brent
Most of my users have email addresses associated with their profile in /etc/passwd. They are always in the 5th field, which I can grab, but they appear at different places within a comma-separated list in the 5th field.
Can somebody give me a regex to grab just the email address (delimeted by commas) from a line in this file? (I will be using…