๐งE-mail
email(email: string): {
include: boolean,
matchs: RegExpMatchArray | null,
groups: Array<{ user: string, domain: string } | null> | null
}Search e-mail in a string:
const { web } = require('regex-simplify');
const email = web.email(`
[email protected]
[email protected]
test @ outlook.com
`);
console.log(email);And here what return the function:
{
include: true,
matchs: [ '[email protected]', '[email protected]' ],
groups: [
[Object: null prototype] {
user: 'lama.loca.loca123',
domain: 'inca.com'
},
[Object: null prototype] { user: 'test', domain: 'test.co.uk' }
]
}Last updated