From 53f9e77140a07eb8f36eeea460f13a54dad7330e Mon Sep 17 00:00:00 2001 From: Giuseppe D'Angelo Date: Sat, 19 Jan 2013 00:35:21 +0000 Subject: QRegularExpression: add method for extracting the capturing group names It may be useful to know which named capturing groups are defined in an regular expression, and for each of them, what's the corresponding index. This commit adds the needed method to QRegularExpression. Note that extracting the information doesn't happen while holding the mutex in the private -- pcre_fullinfo just reads information from the compiled pattern, so that's thread-safe. Task-number: QTBUG-29079 Change-Id: I50c00ee860f06427c2e6ea10417d5c0733cc8303 Reviewed-by: Lars Knoll Reviewed-by: Thiago Macieira --- src/corelib/tools/qregularexpression.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/corelib/tools/qregularexpression.h') diff --git a/src/corelib/tools/qregularexpression.h b/src/corelib/tools/qregularexpression.h index a056b4f01b..97dbee9256 100644 --- a/src/corelib/tools/qregularexpression.h +++ b/src/corelib/tools/qregularexpression.h @@ -46,6 +46,7 @@ #ifndef QT_NO_REGULAREXPRESSION #include +#include #include #include @@ -94,6 +95,7 @@ public: QString errorString() const; int captureCount() const; + QStringList namedCaptureGroups() const; enum MatchType { NormalMatch = 0, -- cgit v1.2.3