Unicode.Set.compile_pattern
You're seeing just the function
compile_pattern
, go back to Unicode.Set module for more information.
Specs
Transforms a Unicode Set into a compiled
pattern that can be used with String.split/3
and String.replace/3
.
Compiled patterns can be the more performant when matching strings.
Arguments
unicode_set
is a string representation of a Unicode Set
Returns
{:ok, compiled_pattern}
or{:error, {exception, reason}}
Example
iex> pattern = Unicode.Set.compile_pattern "[[:digit:]]"
{:ok, {:ac, #Reference<0.2927979228.2367029250.255911>}}
iex> String.split("abc1def2ghi3jkl", pattern)
["abc", "def", "ghi", "jkl"]