2000-12-11 23:40:33 +03:00
|
|
|
#!/usr/bin/perl
|
|
|
|
$integer = '[+-]?[0-9]+';
|
|
|
|
$real = '[+-]?[0-9]+\.[0-9]+';
|
|
|
|
|
2012-07-05 05:47:49 +04:00
|
|
|
$RANGE = '(\.\.)(\.)?';
|
|
|
|
$PLUMIN = q(\'\+\-\');
|
|
|
|
$FLOAT = "(($integer)|($real))([eE]($integer))?";
|
2000-12-11 23:40:33 +03:00
|
|
|
$EXTENSION = '<|>|~';
|
|
|
|
|
2012-07-05 05:47:49 +04:00
|
|
|
$boundary = "($EXTENSION)?$FLOAT";
|
2000-12-11 23:40:33 +03:00
|
|
|
$deviation = $FLOAT;
|
|
|
|
|
|
|
|
$rule_1 = $boundary . $PLUMIN . $deviation;
|
|
|
|
$rule_2 = $boundary . $RANGE . $boundary;
|
|
|
|
$rule_3 = $boundary . $RANGE;
|
|
|
|
$rule_4 = $RANGE . $boundary;
|
|
|
|
$rule_5 = $boundary;
|
|
|
|
|
|
|
|
|
|
|
|
print "$rule_5\n";
|
2012-07-05 05:47:49 +04:00
|
|
|
while (<>)
|
|
|
|
{
|
|
|
|
|
|
|
|
# s/ +//g;
|
|
|
|
if (/^($rule_1)$/)
|
|
|
|
{
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
elsif (/^($rule_2)$/)
|
|
|
|
{
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
elsif (/^($rule_3)$/)
|
|
|
|
{
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
elsif (/^($rule_4)$/)
|
|
|
|
{
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
elsif (/^($rule_5)$/)
|
|
|
|
{
|
|
|
|
print;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
print STDERR "error in $_\n";
|
|
|
|
}
|
2000-12-11 23:40:33 +03:00
|
|
|
|
|
|
|
}
|