【发布时间】:2012-01-20 21:16:07
【问题描述】:
以下是代码:
my $vowels = "[aiou~NFKPQRIJ]";
my @diactok;
for $rx (@tokens) {
$rx =~ s/.\K/$vowels?/g;
if ($diac =~ /($rx)/) {
push @diactok, $diac =~ /$rx/g;
}
}
来自上一个问题:How do I tokenise a word given tokens that are subsumed incompletely in the word?
除了这个错误之外很好(我确实“使用诊断”):
正则表达式中的嵌套量词;由
Note that the minimal matching quantifiers, *?, +?, and ?? appear to be nested quantifiers, but aren't. See perlre.用户代码中未捕获的异常: 正则表达式中的嵌套量词;标记为
第 47 行是这一行:
if ($diac =~ /($rx)/)
我尝试了quotemeta,但没有奏效-也许我用错了?在$diac 中捕获的某些字符串确实具有特殊字符,例如'?' 和'*'。
【问题讨论】: