似乎它无法将带重音的Ó识别为大写字母
#!/usr/bin/env perl
use strict;
use warnings;
use 5.14.0;
use utf8;
use feature 'unicode_strings';
" SIMÓN " =~ /^\s+(\p{Upper}+)/u;
print "$1\n";
返回结果
SIM
Perl应该能够使用Unicode数据,它已经将Ó标记为大写。
来自emacs describe-char
character code properties: customize what to show
name: LATIN CAPITAL LETTER O WITH ACUTE
old-name: LATIN CAPITAL LETTER O ACUTE
general-category: Lu (Letter, Uppercase)
decomposition: (79 769) ('O' '́')