in reply to Re: Regexp \N{name} (use of \e)
#!/opt/perl/bin/perl use strict; use warnings; use charnames ':full'; binmode STDOUT, ":utf8"; my $string = ':)'; print "$string becomes: "; $string =~ s/:\)/\N{WHITE SMILING FACE}/; print "$string\n$string becomes: "; $string =~ s/\N{WHITE SMILING FACE}/\N{BLACK SMILING FACE}/; print "$string\n$string becomes: "; $string =~s/\N{BLACK SMILING FACE}/:\)/; print "$string\n";
That should cover most uses of \N{CHARNAME}.
charnames and perlre are the best references.
Update: added #! to example
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
| A reply falls below the community's threshold of quality. You may see it by logging in. |