#!/usr/bin/perl
$_ = "-&1234#9032";
if (/^-?&\d+\.?\d*/) {
print "matched\n";
}else {
print "not matched\n";
}
if (/^-?& \d+ \.? \d* /) {
print "matched\n";
}else {
print "not matched\n";
}
./x.pl
matched
not matched
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |