Replace Unicode character using regex with Perl
Answer:
To use regex to replace Perl's Unicode string, you can try the following.
$text =~ s/[\x{0000}-\x{007F}]+/ /g;
The above code replace all Unicode with codepoint from 0 to 127 by a space.
Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.
Replace Unicode character using regex with Perl
Answer:
To use regex to replace Perl's Unicode string, you can try the following.
$text =~ s/[\x{0000}-\x{007F}]+/ /g;
The above code replace all Unicode with codepoint from 0 to 127 by a space.