From 2d3357ed71262220ee2868f6f3d49738ab54171d Mon Sep 17 00:00:00 2001 From: ivandi Date: Fri, 16 Feb 2024 23:44:43 -0500 Subject: [PATCH] Relax regexs to allow variable names that include point Variable names like h2.out are valid so no reason to restrict them in custom simulation dialog and scalars print parser. --- qucs/extsimkernels/abstractspicekernel.cpp | 2 +- qucs/extsimkernels/customsimdialog.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qucs/extsimkernels/abstractspicekernel.cpp b/qucs/extsimkernels/abstractspicekernel.cpp index 4c34c1686..52b38308a 100644 --- a/qucs/extsimkernels/abstractspicekernel.cpp +++ b/qucs/extsimkernels/abstractspicekernel.cpp @@ -1107,7 +1107,7 @@ int AbstractSpiceKernel::checkRawOutupt(QString ngspice_file, QStringList &value bool isXyce = false; if (ofile.open(QFile::ReadOnly)) { QTextStream ngsp_data(&ofile); - QRegularExpression prnln_rx("^\\D\\w*\\s=\\s-?\\d.\\d+[Ee][+-]\\d+"); + QRegularExpression prnln_rx("^[A-Za-z].*\\s=\\s-?\\d.\\d+[Ee][+-]\\d+"); QRegularExpression rx("^0\\s+[0-9].*"); // Zero index pattern while (!ngsp_data.atEnd()) { QString lin = ngsp_data.readLine(); diff --git a/qucs/extsimkernels/customsimdialog.cpp b/qucs/extsimkernels/customsimdialog.cpp index f8ba6a34e..c658ff0a8 100644 --- a/qucs/extsimkernels/customsimdialog.cpp +++ b/qucs/extsimkernels/customsimdialog.cpp @@ -192,7 +192,7 @@ void CustomSimDialog::slotFindVars() QStringList strings = edtCode->toPlainText().split('\n'); - QRegularExpression let_pattern("^\\s*let\\s+[A-Za-z]+\\w*\\s*=.+"); + QRegularExpression let_pattern("^\\s*let\\s+[A-Za-z].*=.+"); for (const QString& line : strings) { if (let_pattern.match(line).hasMatch()) {