I'm trying to use the following W3C Email Regex in Elixir (source: RegexPal):
/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/
In a function that looks like this
def get_type(value) do
cond do
String.match?(value, ~r/^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/) ->
:email
String.match?(value, ~r/^\+[1-9][0-9]\d{1,14}$/) ->
:phone_number
end
end
But I'm getting a compilation error
unexpected token: "`" (column 56, code point U+0060)
What am I doing wrong here?