【发布时间】:2011-09-24 05:43:49
【问题描述】:
my ($INV_NB, $USAGE)=split /\|/,"9998|999999999999999";
if ($USAGE=~/^\d{15}\b/)
{
print "\nUSAGE is Valid\n";
print "length of $USAGE is ",length($USAGE);
}
这按预期工作,但我怎样才能否定这个正则表达式?说如果使用不是/^\d{15}\b/
if ($USAGE!=~/^\d{15}\b/)
{
print "\nUSAGE is Invalid\n";
print "length of $USAGE is ",length($USAGE);
}
我试过了,但它不起作用..
【问题讨论】:
-
还有
unless (EXPR) BLOCK,可能让意思更明显。