Skip to content

Instantly share code, notes, and snippets.

View houmanka's full-sized avatar

Houman Kargaran houmanka

View GitHub Profile
iex(16)> str = "[email protected]"
"[email protected]"
iex(17)> [email, username, host] = Regex.run(~r/(\w+)@([\w.]+)/, str)
["[email protected]", "riza", "elixirdose.com"]
iex(18)> email
"[email protected]"
iex(19)> username
"riza"
iex(20)> host
"elixirdose.com"