From 475f66e2460ab2ab26953402975b4a81a1948294 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 6 Aug 2022 14:31:14 +0200 Subject: [PATCH] Improve wxRegEx::GetMatch() return value documentation Don't imply that the function returns false for the empty capture groups because this is not the case (and never was). See #22708. (cherry picked from commit 537f11fd4d258d11454a75fa5891e4f011ff0da5) --- interface/wx/regex.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/interface/wx/regex.h b/interface/wx/regex.h index dc56ad1c81..31a320ad71 100644 --- a/interface/wx/regex.h +++ b/interface/wx/regex.h @@ -240,8 +240,12 @@ public: May only be called after successful call to Matches() and only if @c wxRE_NOSUB was @b not used in Compile(). - Returns @false if no match or if an error occurred. - + This function only returns @false if the regex didn't match at all or + one of the arguments is invalid (e.g. @a index is greater or equal than + the number of captures) and returns @true in all the other cases, even + if the corresponding capture group didn't match anything, which can be + the case when using captures in different alternation (@c "|"). In this + case the returned @a len is @c 0 and @a start is @c -1. */ bool GetMatch(size_t* start, size_t* len, size_t index = 0) const;