Unicode.Guards (Unicode function guards for Elixir v0.4.0) View Source

Defines a set of guards that can be used with Elixir functions.

Each guard operates on a UTF8 codepoint since the permitted operators in a guard clause are restricted to simple comparisons that do not include string comparators.

The data that underpins these guards is generated from the Unicode character database and therefore includes a broad range of scripts well beyond the basic ASCII definitions.

Link to this section Summary

Functions

Guards whether a UTF8 codepoint is a space character.

Guards whether a UTF8 codepoint is a currency symbol character.

Guards whether a UTF8 codepoint is a digit character.

Guards whether a UTF8 codepoint is a graphic character.

Guards whether a UTF8 codepoint is a lower case character.

Guargs where a UTF8 codepoint is a printing character.

Guards whether a UTF8 codepoint is a printable.

Guards whether a UTF8 codepoint is a unicode quote symbol character.

Guards whether a UTF8 codepoint is a unicode quote symbol that can be used either left or right.

Guards whether a UTF8 codepoint is a unicode quote symbol that is considered a single quote.

Guards whether a UTF8 codepoint is a unicode left quote symbol character.

Guards whether a UTF8 codepoint is a unicode right quote symbol character.

Guards whether a UTF8 codepoint is a unicode quote symbol that is considered a single quote.

Guards whether a UTF8 codepoint is a unicode separator symbol character.

Guards whether a UTF8 codepoint is an upper case character.

Guards whether a UTF8 codepoint is a whitespace symbol character.

Link to this section Functions

Link to this macro

is_blank(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a space character.

This is the Unicode definition of those characters that horizontal space (space, non-breaking space etc) as well as the horizontal tab character.

Link to this macro

is_currency_symbol(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a currency symbol character.

Link to this macro

is_digit(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a digit character.

This guard will match any digit character from any Unicode script, not only the ASCII decimal digits.

Link to this macro

is_graph(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a graphic character.

This is the Unicode definition of those characters that are visible. It is defined as those characters that are non-space, non-control and non-surrogate.

Link to this macro

is_lower(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a lower case character.

The match is for any UTF8 character that is defined in Unicode to be an lower case character in any script.

Link to this macro

is_print(codepoint)

View Source (macro)

Guargs where a UTF8 codepoint is a printing character.

This is the Unicode definition which is a combination of the [:graph:] set and the [:blank:] set.

Link to this macro

is_printable(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a printable.

The definition of what is printable is the same as used by String.printable?/1

Link to this macro

is_quote_mark(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode quote symbol character.

This includes the Unicode set Pi, Pf and other characters documents in this Wikpedia article.

See also Unicode.Category.QuoteMarks.

Link to this macro

is_quote_mark_ambidextrous(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode quote symbol that can be used either left or right.

See also Unicode.Category.QuoteMarks.

Link to this macro

is_quote_mark_double(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode quote symbol that is considered a single quote.

See also Unicode.Category.QuoteMarks.

Link to this macro

is_quote_mark_left(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode left quote symbol character.

See also Unicode.Category.QuoteMarks.

Link to this macro

is_quote_mark_right(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode right quote symbol character.

See also Unicode.Category.QuoteMarks.

Link to this macro

is_quote_mark_single(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode quote symbol that is considered a single quote.

See also Unicode.Category.QuoteMarks.

Link to this macro

is_separator(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a unicode separator symbol character.

This includes the Unicode set Zs plus the characters.

Link to this macro

is_upper(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is an upper case character.

The match is for any UTF8 character that is defined in Unicode to be an upper case character in any script.

Link to this macro

is_whitespace(codepoint)

View Source (macro)

Guards whether a UTF8 codepoint is a whitespace symbol character.

This includes the Unicode set Zs plus the characters in the range 0x9-0xd which incudes tab, newline and carriage return.