Strip zone overrides "(xx)" and "[xx]" and leading "=" from a prefix token.
| 13 | |
| 14 | // Strip zone overrides "(xx)" and "[xx]" and leading "=" from a prefix token. |
| 15 | static QString cleanPrefix(const QString& raw) |
| 16 | { |
| 17 | QString s = raw.trimmed(); |
| 18 | // remove zone overrides like (14) and [14] |
| 19 | static const QRegularExpression zoneRe(R"(\([^)]*\)|\[[^\]]*\])"); |
| 20 | s.remove(zoneRe); |
| 21 | s = s.trimmed(); |
| 22 | return s; |
| 23 | } |
| 24 | |
| 25 | // --------------------------------------------------------------------------- |
| 26 | // Public API |