mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2026-01-05 18:45:55 -05:00
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:
parent
0c07ffba16
commit
99b7407a02
5 changed files with 54 additions and 2 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue