diff --git a/widgets/displaytext.cpp b/widgets/displaytext.cpp index ae865bc9d..ef91761fc 100644 --- a/widgets/displaytext.cpp +++ b/widgets/displaytext.cpp @@ -553,7 +553,14 @@ void DisplayText::highlight_callsign (QString const& callsign, QColor const& bg, { return; } - QRegularExpression target {QString {"?"}, QRegularExpression::DontCaptureOption}; + auto regexp = callsign; + // allow for hashed callsigns and escape any regexp metacharacters + QRegularExpression target {QString {"?"} + , QRegularExpression::DontCaptureOption}; QTextCharFormat old_format {currentCharFormat ()}; QTextCursor cursor {document ()}; if (last_period_only)