http://qs321.pair.com?node_id=1233109


in reply to Match full utf-8 characters

This is a workaround but should remove all non 255-ASCII characters:

use strict; use warnings; use utf8; my $str = 'a…b'; $str =~ s/(.)/ord($1)<256?$1:''/ge; print "$str\n";

Replies are listed 'Best First'.
Re^2: Match full utf-8 characters
by Allasso (Monk) on Apr 29, 2019 at 13:40 UTC
    This works if $str is implicitly provided in the script, but not when it is read from stdin.