I am trying to remove invisible characters from string
see remove-zero-width-space-characters
iex> str = "\uFEFF<?xml>"
iex> String.replace(str, ~r/[\u200B\u200C\u200D\uFEFF]/, "")
** (Regex.CompileError) PCRE does not support \L, \l, \N{name}, \U, or \u at position 1
(elixir) lib/regex.ex:171: Regex.compile!/2
(elixir) expanding macro: Kernel.sigil_r/2
iex:44: (file)
error:
PCRE does not support \L, \l, \N{name}, \U, or \u at position 1
how can I implement the above regex?
Note: When using a string instead regex it works, but for code efficiency I would like to use regex
iex(34)> String.replace(a, "\uFEFF", "")
"<?xml>"