I'm trying to remove characters using regular expressions in Perl. After showing :set list on vim, the characters, with formatting are shown below:
R$
$
e$
a$
$
di$
n$
U$
This substitution works, but it is too broad for my purposes:
$text =~ s/\w{1,2}//g;
The substitution I would like to make is:
$text =~ s/\w{1,2}$//g;
However, that does not remove any of the below characters. I am confused as to why this is. I'm wondering whether this has to do with possible Unicode characters; if so, how do I see and remove them?