Fix fallback: escape regex special chars

This commit is contained in:
2026-04-16 13:48:28 -03:00
parent 2ef98aaea5
commit bff306d91f
+2 -1
View File
@@ -729,7 +729,8 @@ for (const linea of lineas) {
if (lineaLower.includes(clave)) {
let match = linea.match(/show_chart.*?(\d+\.?\d*)/);
if (!match) {
match = linea.match(new RegExp(clave + '.*?(\\d+\\.?\\d*)'));
const claveEscaped = clave.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
match = linea.match(new RegExp(claveEscaped + '.*?(\\d+\\.?\\d*)'));
}
if (match && match[1]) {
const valor = parseFloat(match[1].replace(',', '.'));