From 7dfe51ab8e338a7b62c2d3993b2da1b9004a228c Mon Sep 17 00:00:00 2001 From: Bill Somerville Date: Tue, 23 Jul 2019 02:02:39 +0100 Subject: [PATCH] Fix up message parsing regexp to handle 4 character directional CQs This defect was causing new grids not to be highlighted when 1, 3, or 4 directional CQ words were used, as allowed by the 77-bit source encoding. --- decodedtext.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/decodedtext.cpp b/decodedtext.cpp index bfa808173..98ef9c066 100644 --- a/decodedtext.cpp +++ b/decodedtext.cpp @@ -10,7 +10,7 @@ extern "C" { namespace { - QRegularExpression words_re {R"(^(?:(?(?:CQ|DE|QRZ)(?:\s?DX|\s(?:[A-Z]{2}|\d{3}))|[A-Z0-9/]+)\s)(?:(?[A-Z0-9/]+)(?:\s(?[-+A-Z0-9]+)(?:\s(?(?:OOO|(?!RR73)[A-R]{2}[0-9]{2})))?)?)?)"}; + QRegularExpression words_re {R"(^(?:(?(?:CQ|DE|QRZ)(?:\s?DX|\s(?:[A-Z]{1,4}|\d{3}))|[A-Z0-9/]+)\s)(?:(?[A-Z0-9/]+)(?:\s(?[-+A-Z0-9]+)(?:\s(?(?:OOO|(?!RR73)[A-R]{2}[0-9]{2})))?)?)?)"}; } DecodedText::DecodedText (QString const& the_string) @@ -168,11 +168,6 @@ void DecodedText::deCallAndGrid(/*out*/QString& call, QString& grid) const call = match.captured ("word2"); grid = match.captured ("word3"); if ("R" == grid) grid = match.captured ("word4"); - if(match.captured("word1")=="CQ" and call.length()<=4 and !call.contains(QRegExp("[0-9]"))) { - //Second word has length 1-4 and contains no digits - call = match.captured ("word3"); - grid = match.captured ("word4"); - } } unsigned DecodedText::timeInSeconds() const