+ 1

Write a program which separates emails from other characters.

Imagine there is a long list of usernames,emails and passwords.Write a program which output will be only the emails '@' sign. ex. input:alex || gismo4l3x | [email protected] u77 kgghhjouy bv hhj gmail.com output: [email protected]

25th Apr 2018, 11:28 PM
Blue Dragon
Blue Dragon - avatar
2 Answers
25th Apr 2018, 11:50 PM
LordHill
LordHill - avatar
+ 1
This is often done with regex: an example I found on stack overflow var re = /^(([^<>()\[\]\.,;:\[email protected]\"]+(\.[^<>()\[\]\.,;:\[email protected]\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\[email protected]\"]+\.)+[^<>()[\]\.,;:\[email protected]\"]{2,})$/i;
25th Apr 2018, 11:52 PM
Alejandro Aristizabal
Alejandro Aristizabal - avatar