Skip to contents

Is it an email address?

Usage

is_email(x)

Arguments

x

A character vector.

Value

Logical vector; TRUE for a syntactically valid email, NA for NA.

Details

A pragmatic pattern (local @ domain . TLD), not the full RFC 5322 grammar. Rejects spaces and a missing TLD.

See also

Other web detectors: is_ipv4(), is_ipv6(), is_mac(), is_url()

Examples

is_email(c("a.b@example.com", "no-at-sign", NA))
#> [1]  TRUE FALSE    NA