How can I grep out only the email address using a regex from a file with multiple lines similar to this. (a sql dump to be precise)
Unfortunately I cannot just go b
The best way to handle this is with a proper CSV parser. A simple way to accomplish that, if it's a one-time task, is to load the CSV file into your favorite spreadsheet software, then extract just the email field.
It is difficult to parse CSV with a regex, because of the possibility of escaped commas, quoted text, etc.
Consider, the following are valid email addresses, according to Internet standards:
If you know for a fact that you will never have this sort of data, then perhaps simple grep and awk tools will work (as in @anubhava's answer).