2000-12-11 23:40:33 +03:00
|
|
|
#!/usr/bin/perl
|
2016-12-04 20:00:00 +03:00
|
|
|
|
2023-01-02 23:00:37 +03:00
|
|
|
# Copyright (c) 2021-2023, PostgreSQL Global Development Group
|
2021-05-07 17:56:14 +03:00
|
|
|
|
2016-12-04 20:00:00 +03:00
|
|
|
use strict;
|
2020-04-13 18:55:45 +03:00
|
|
|
use warnings;
|
2016-12-04 20:00:00 +03:00
|
|
|
|
|
|
|
my $integer = '[+-]?[0-9]+';
|
|
|
|
my $real = '[+-]?[0-9]+\.[0-9]+';
|
|
|
|
|
|
|
|
my $RANGE = '(\.\.)(\.)?';
|
|
|
|
my $PLUMIN = q(\'\+\-\');
|
|
|
|
my $FLOAT = "(($integer)|($real))([eE]($integer))?";
|
|
|
|
my $EXTENSION = '<|>|~';
|
|
|
|
|
|
|
|
my $boundary = "($EXTENSION)?$FLOAT";
|
|
|
|
my $deviation = $FLOAT;
|
|
|
|
|
|
|
|
my $rule_1 = $boundary . $PLUMIN . $deviation;
|
|
|
|
my $rule_2 = $boundary . $RANGE . $boundary;
|
|
|
|
my $rule_3 = $boundary . $RANGE;
|
|
|
|
my $rule_4 = $RANGE . $boundary;
|
|
|
|
my $rule_5 = $boundary;
|
2000-12-11 23:40:33 +03:00
|
|
|
|
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
}
|