Fix regex: buscar cualquier numero despues de show_chart

This commit is contained in:
2026-04-16 13:21:32 -03:00
parent 08a3a0105f
commit 4969f06e2d
+1 -1
View File
@@ -728,7 +728,7 @@ for (const linea of lineas) {
for (const [clave, info] of Object.entries(mapeoParametros)) { for (const [clave, info] of Object.entries(mapeoParametros)) {
if (lineaLower.includes(clave)) { if (lineaLower.includes(clave)) {
// buscar primer número puro después de show_chart // buscar primer número puro después de show_chart
const match = linea.match(/show_chart\s+[\w\s]+\s+(\d+\.?\d*)/); const match = linea.match(/show_chart.*?(\d+\.?\d*)/);
if (match && match[1]) { if (match && match[1]) {
const valor = parseFloat(match[1].replace(',', '.')); const valor = parseFloat(match[1].replace(',', '.'));
if (!isNaN(valor) && valor > 0 && valor < 1000) { if (!isNaN(valor) && valor > 0 && valor < 1000) {