Unicode.LinkEmail (Unicode v2.2.0)

Copy Markdown View Source

Functions to introspect the Link_Email property for binaries (Strings) and codepoints.

Link_Email is the set of characters valid in the local part of an email address — the portion before the @ — as defined by UTS #58.

Unlike the enumerated properties this is binary: a codepoint is either in the set or it is not. It therefore does not implement Unicode.Property.Behaviour, which assumes a map of values to ranges, and the primary API is the predicate link_email?/1.

Summary

Functions

Returns the count of codepoints valid in an email local part.

Returns whether a codepoint or every codepoint of a string is valid in an email local part.

Returns the codepoint ranges of the Link_Email property.

Functions

count()

Returns the count of codepoints valid in an email local part.

Returns

  • A non-negative integer count.

Examples

iex> Unicode.LinkEmail.count() > 100_000
true

ranges()

Returns the codepoint ranges of the Link_Email property.

Returns

  • A list of codepoint ranges as 2-tuples.

Examples

iex> Unicode.LinkEmail.ranges() |> is_list()
true