defmodule Main do
def main do
a = ~r/[\_\.,:;\?¿¡\!&@$%\^]/u
b = ~r/[[:punct:]]/u
y = "¿Habla usted Inglés, por favor?"
IO.inspect String.replace(y, a, "")
# -> "Habla usted Inglés por favor"
IO.inspect String.replace(y, b, "")
# -> <<194, 72, 97, 98, 108, 97, 32, 117, 115, 116, 101, 100, 32, 73, 110, 103, 108, 195, 115, 32, 112, 111, 114, 32, 102, 97, 118, 111, 114>>
end
end
Main.main
ZGVmbW9kdWxlIE1haW4gZG8KICBkZWYgbWFpbiBkbwogICAgYSA9IH5yL1tcX1wuLDo7XD/Cv8KhXCEmQCQlXF5dL3UKYiA9IH5yL1tbOnB1bmN0Ol1dL3UKeSA9ICLCv0hhYmxhIHVzdGVkIEluZ2zDqXMsIHBvciBmYXZvcj8iCklPLmluc3BlY3QgU3RyaW5nLnJlcGxhY2UoeSwgYSwgIiIpICAKICAgICMgLT4gICJIYWJsYSB1c3RlZCBJbmdsw6lzIHBvciBmYXZvciIKSU8uaW5zcGVjdCBTdHJpbmcucmVwbGFjZSh5LCBiLCAiIikKICAgICMgLT4gPDwxOTQsIDcyLCA5NywgOTgsIDEwOCwgOTcsIDMyLCAxMTcsIDExNSwgMTE2LCAxMDEsIDEwMCwgMzIsIDczLCAxMTAsIDEwMywgMTA4LCAxOTUsIDExNSwgMzIsIDExMiwgMTExLCAxMTQsIDMyLCAxMDIsIDk3LCAxMTgsIDExMSwgMTE0Pj4KICBlbmQKZW5kCgpNYWluLm1haW4K