I have a string like below
stringinput = Sweééééôden@
I want to get output like
stringoutput = Sweden
the spl characters ééééô
and @
has to be removed.
Am using
$stringoutput = `echo $stringinput | sed 's/[^a-z A-Z 0-9]//g'`;
I am getting result like Sweééééôden
but ééééô
is not getting removed.
Can you please suggest what I have to add
You need to use
LC_ALL=C
beforesed
command to make[A-Za-z]
character class create ranges as per ASCII table:See the online demo:
See POSIX regex reference:
In Perl, you could simply use
See this online demo.