fedicrawl/application/src/StringTools/extractEmails.ts

5 wiersze
188 B
TypeScript
Czysty Zwykły widok Historia

2021-12-23 14:14:06 +00:00
export const extractEmails = (text:string):string[] => {
return (text.match(/([a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9._-]+)/gi) || [])
.map(email => email.toLowerCase()) || []
}