Skip to content

Instantly share code, notes, and snippets.

@anderseknert
Created March 27, 2019 08:46
Show Gist options
  • Save anderseknert/50ae4e8131c341b64dd00a6ad7f8dd03 to your computer and use it in GitHub Desktop.
Save anderseknert/50ae4e8131c341b64dd00a6ad7f8dd03 to your computer and use it in GitHub Desktop.
Extract all e-mail addresses from a list of Outlook recepients (formatted as "FirstName LastName <actual@email.com>; ...")
#!/usr/bin/env guile
!#
(use-modules (ice-9 textual-ports)
(ice-9 regex))
(let* ((input (get-string-all (current-input-port)))
(matches (list-matches "[^<]*<([^>]+)>+" input))
(extractor (lambda (match) (match:substring match 1))))
(display (map extractor matches)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment