在Perl6中,不间断空间被认为是空间,所以
say 'Perl6' ~~ / / # Please understand there's a no-break space in the middle@H_502_2@产生
Null regex not allowed@H_502_2@解决方案是引用角色,就像这样
say 'Perl6' ~~ / '' / ; # OUTPUT: «「」»@H_502_2@但是,如果要在字符类中包含不间断的空格,则不起作用:
$str ~~ /<[ & < > " ' { ]>/ )@H_502_2@我可以使用
Zs
,这是一个空间分隔符,但那个看起来更广泛……还有其他方法吗?
引用也无济于事.问题是,我应该在那里使用什么角色类?