From bff306d91f336d8fb1c5f4d6597d3fbeaea94824 Mon Sep 17 00:00:00 2001 From: Sergio Nicolas Lavaise Date: Thu, 16 Apr 2026 13:48:28 -0300 Subject: [PATCH] Fix fallback: escape regex special chars --- src/sections/HistoriaClinica.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sections/HistoriaClinica.tsx b/src/sections/HistoriaClinica.tsx index fb4e0f4..43b7184 100644 --- a/src/sections/HistoriaClinica.tsx +++ b/src/sections/HistoriaClinica.tsx @@ -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(',', '.'));