extract-email-address 📧
Extracts email address from an arbitrary text input.
API
;; : $ReadOnlyArray<EmailMatchType>;
Usage
; ;// [{email: 'gajus@gajus.com'}] ;// [{email: 'foo@gajus.com'}, {email: 'bar@gajus.com'}] ;// [{email: 'foo@bar.com'}, {email: 'baz@qux.com'}] ;// [{email: 'gajus+foo@gajus.com'}] ;// [{email: 'gajus@gajus.com'}] ;// [{email: 'gajus@gajus.com'}] ;// [] ;// []
Filtering results
Some matches might be syntactically valid email addresses, but not actual email addresses, e.g. apple-touch-icon@2.png
.
extract-email-address
uses a list of valid top-level domains to filter out matches that are definitely not emails (such as png
example), but you might still need to filter out domain specific false-positives.
Related projects
extract-date
– Extracts date from an arbitrary text input.extract-price
– Extracts price from an arbitrary text input.extract-time
– Extracts time from an arbitrary text input.