1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

csv node - better regex for number detection

This commit is contained in:
Dave Conway-Jones 2018-10-26 09:24:56 +01:00
parent 8f94c5efeb
commit 1c4df785fd
No known key found for this signature in database
GPG Key ID: 9E7F9C73F5168CD4

View File

@ -138,7 +138,7 @@ module.exports = function(RED) {
var line = msg.payload;
var linecount = 0;
var tmp = "";
var reg = /^[-]?[0-9]*\.?[0-9]+$/;
var reg = /^[-]?(?!0\d)\d*\.?\d*(E-?\+?)?\d+$/i;
if (msg.hasOwnProperty("parts")) {
linecount = msg.parts.index;
if (msg.parts.index > node.skip) { first = false; }