Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Match full utf-8 characters

by hdb (Monsignor)
on Apr 29, 2019 at 12:38 UTC ( [id://1233109]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1233109]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (5)
As of 2024-04-19 22:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found