Unicode.Set.match-question-mark
You're seeing just the macro
match-question-mark
, go back to Unicode.Set module for more information.
Returns a boolean based upon whether var
matches the provided unicode_set
.
Arguments
var
is any integer variable (since codepoints are integers)unicode_set
is a binary representation of a unicode set. An exception will be raised ifunicode_set
is not a compile time binary
Returns
true
orfalse
Examples
Unicode.Set.match?/2
can be used withdefguard/1
. For example:
defguard is_lower(codepoint) when Unicode.Set.match?(codepoint, "[[:Lu:]]")
- Or as a guard clause itself:
def my_function(<< codepoint :: utf8, _rest :: binary>>)
when Unicode.Set.match?(codepoint, "[[:Lu:]]")