Unicode.Set.to_regex_string

You're seeing just the function to_regex_string, go back to Unicode.Set module for more information.
Link to this function

to_regex_string(unicode_set)

View Source

Specs

to_regex_string(binary()) :: {:ok, binary()} | {:error, {module(), binary()}}

Transforms a Unicode Set into a regex string that can be used as an argument to Regex.compile/1.

Arguments

  • unicode_set is a string representation of a Unicode Set

Returns

  • {:ok, regex_string} or

  • {:error, {exception, reason}}

Example

    iex> Unicode.Set.to_regex_string "[[:Zs]-[ ]]"
    {:ok, "[\x{3A}\x{5A}\x{73}]"}