(s: string)
| 95 | } |
| 96 | |
| 97 | export function emailInString(s: string) { |
| 98 | const emailRegex = /[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*/; |
| 99 | try { |
| 100 | return emailRegex.exec(s)?.pop() || ''; |
| 101 | } catch (error) { |
| 102 | return ''; |
| 103 | } |
| 104 | } |
no test coverage detected