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(',', '.'));