mirror of
https://github.com/dkogan/feedgnuplot.git
synced 2025-05-06 06:21:16 +08:00
now using \d to match digits
This commit is contained in:
parent
9c1d6326d8
commit
cbba09917b
@ -11,7 +11,7 @@ use Thread::Queue;
|
|||||||
use Text::ParseWords;
|
use Text::ParseWords;
|
||||||
|
|
||||||
open(GNUPLOT_VERSION, "gnuplot --version |");
|
open(GNUPLOT_VERSION, "gnuplot --version |");
|
||||||
my ($gnuplotVersion) = <GNUPLOT_VERSION> =~ /gnuplot\s*([0-9]*\.[0-9]*)/;
|
my ($gnuplotVersion) = <GNUPLOT_VERSION> =~ /gnuplot\s*(\d*\.\d*)/;
|
||||||
if(!$gnuplotVersion)
|
if(!$gnuplotVersion)
|
||||||
{
|
{
|
||||||
print STDERR "Couldn't find the version of gnuplot. Does it work? Trying anyway...\n";
|
print STDERR "Couldn't find the version of gnuplot. Does it work? Trying anyway...\n";
|
||||||
@ -347,7 +347,7 @@ sub mainThread {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# regexp for a possibly floating point, possibly scientific notation number, fully captured
|
# regexp for a possibly floating point, possibly scientific notation number, fully captured
|
||||||
my $numRE = qr/([-]?[0-9\.]+(?:e[-+]?[0-9]+)?)/io;
|
my $numRE = qr/([-]?[\d\.]+(?:e[-+]?\d+)?)/io;
|
||||||
my $xlast;
|
my $xlast;
|
||||||
my $haveNewData;
|
my $haveNewData;
|
||||||
|
|
||||||
@ -389,7 +389,7 @@ sub mainThread {
|
|||||||
|
|
||||||
if($options{dataindex})
|
if($options{dataindex})
|
||||||
{
|
{
|
||||||
while(/([0-9]+)\s+$numRE/go)
|
while(/(\d+)\s+$numRE/go)
|
||||||
{
|
{
|
||||||
my $idx = $1;
|
my $idx = $1;
|
||||||
my $point = $2;
|
my $point = $2;
|
||||||
|
Loading…
Reference in New Issue
Block a user