Implement {UUID} placeholder and nested reference support (#12511)

* Closes #12509
* Implement the {UUID} placeholder
* Implement nested placeholder de-referencing when resolving entry references to support a reference like {REF:U@I:{UUID}} which is equivalent to {USERNAME} placeholder.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: droidmonkey <2809491+droidmonkey@users.noreply.github.com>
Co-authored-by: Jonathan White <support@dmapps.us>
This commit is contained in:
Copilot 2025-09-27 19:08:22 -04:00 committed by Jonathan White
parent 0c07ffba16
commit 99b7407a02
No known key found for this signature in database
GPG key ID: 440FC65F2E0C6E01
5 changed files with 54 additions and 2 deletions

View file

@ -323,8 +323,9 @@ bool EntryAttributes::operator!=(const EntryAttributes& other) const
QRegularExpressionMatch EntryAttributes::matchReference(const QString& text)
{
// Updated regex to handle nested braces in SearchText (e.g., {UUID})
static const QRegularExpression referenceRegExp(
R"(\{REF:(?<WantedField>[TUPANI])@(?<SearchIn>[TUPANIO]):(?<SearchText>[^}]+)\})",
R"(\{REF:(?<WantedField>[TUPANI])@(?<SearchIn>[TUPANIO]):(?<SearchText>(?:[^{}]|\{[^}]*\})+)\})",
QRegularExpression::CaseInsensitiveOption);
return referenceRegExp.match(text);