Iโm trying to make a regex to remove emojis based on this thread:
This causes an error:
Regex.replace(~r/[\u{1F600}-\u{1F6FF}]/, "๐ฐ Monies! ๐ฒ", "")
# (Regex.CompileError) PCRE does not support \L, \l, \N{name}, \U, or \u at position 2
I tried using \x{FFFF}
syntax instead according to this: Regex Tutorial - Unicode Characters and Properties
But I get another error:
Regex.replace(~r/[\x{1F600}-\x{1F6FF}]/, "๐ฐ Monies! ๐ฒ", "")
# (Regex.CompileError) character value in \x{} or \o{} is too large at position 9
Apparently I also need u
to enable unicode but that doesnt seem to work either:
Regex.replace(~r/[\x{1F600}-\x{1F6FF}]/u, "๐ฐ Monies! ๐ฒ", "")
"๐ฐ Monies! ๐ฒ"