From de6f208a4d7a07c4ac02dbc3ebfd0631255b5d01 Mon Sep 17 00:00:00 2001 From: aa5sh <84428382+aa5sh@users.noreply.github.com> Date: Tue, 24 Sep 2024 07:41:39 -0500 Subject: [PATCH] UpdateRegEx I've noticed a few times if people put like CQ POTA the callsign shows up as that way in the WSJTX Widget and subsequently the Alerts Widget. This is a more detailed RegEx I found and tweaked to try and combat that. --- ui/WsjtxWidget.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ui/WsjtxWidget.cpp b/ui/WsjtxWidget.cpp index e956c50b..2b41832e 100644 --- a/ui/WsjtxWidget.cpp +++ b/ui/WsjtxWidget.cpp @@ -21,7 +21,7 @@ MODULE_IDENTIFICATION("qlog.ui.wsjtxswidget"); WsjtxWidget::WsjtxWidget(QWidget *parent) : QWidget(parent), ui(new Ui::WsjtxWidget), - cqRE("^CQ (DX |TEST |[A-Z]{0,2} )?([A-Z0-9\\/]+) ?([A-Z]{2}[0-9]{2})?.*") + cqRE("(^(?:(?P(?:CQ|DE|QRZ)(?:\\s?DX|\\s(?:[A-Z]{1,4}|\\d{3}))|[A-Z0-9\\/]+|\\.{3})\\s)(?:(?P[A-Z0-9\\/]+)(?:\\s(?P[-+A-Z0-9]+)(?:\\s(?P(?:OOO|(?!RR73)[A-R]{2}[0-9]{2})))?)?)?)") { FCT_IDENTIFICATION; @@ -64,8 +64,8 @@ void WsjtxWidget::decodeReceived(WsjtxDecode decode) WsjtxEntry entry; entry.decode = decode; - entry.callsign = match.captured(2); - entry.grid = match.captured(3); + entry.callsign = match.captured(3); + entry.grid = match.captured(4); entry.dxcc = Data::instance()->lookupDxcc(entry.callsign); entry.status = Data::instance()->dxccStatus(entry.dxcc.dxcc, currBand, BandPlan::MODE_GROUP_STRING_DIGITAL); entry.receivedTime = QDateTime::currentDateTimeUtc();