Skip to navigation
Extract all emails from bash string
07.10.21
Extract all emails from bash string string="foo@bar.com bar@foo.com" emails=$(echo $string | grep -Po '\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+') emails=${emails//[$'\t\r\n']} && emails=${emails%%*( )} #remove newline echo "${emails}" #show it
Reply
Anonymous
Information Epoch 1732527478
Distrust all claims for one true way.
Home
Notebook
Contact us