Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function solve(args) {
- const exEmails = [];
- args.forEach((str) => {
- const emailReg = str.match(/(^|(?<=\s))(([a-zA-Z0-9]+)([\.\-_]?)([A-Za-z0-9]+)(@)([a-zA-Z]+([\.\-_][A-Za-z]+)+))(\b|(?=\s))/g);
- if (emailReg !== null) {
- exEmails.push(emailReg);
- }
- });
- if (exEmails !== 0) {
- exEmails.forEach((email) => {
- console.log(email.join('\n'));
- });
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement