Skip to content

PythonQt.QtCore.QRegularExpressionMatch · declarations 001

Back to PythonQt.QtCore.QRegularExpressionMatch

captured

captured(name: Any) -> str

X.captured(name) -> str

Supplemental documentation: Qt 5 reference:

QString QRegularExpressionMatch::captured(int nth \= 0) const

Returns the substring captured by the nth capturing group.

If the nth capturing group did not capture a string, or if there is no such capturing group, returns a null QString.

Note: The implicit capturing group number 0 captures the substring matched by the entire pattern.

See also capturedRef(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(), capturedLength(), and QString::isNull().

QString QRegularExpressionMatch::captured(const QString \&name) const

Returns the substring captured by the capturing group named name.

If the named capturing group name did not capture a string, or if there is no capturing group named name, returns a null QString.

See also capturedRef(), capturedView(), capturedStart(), capturedEnd(), capturedLength(), and QString::isNull().

QString QRegularExpressionMatch::captured(QStringView name) const

Returns the substring captured by the capturing group named name.

If the named capturing group name did not capture a string, or if there is no capturing group named name, returns a null QString.

This function was introduced in Qt 5.10.

See also capturedRef(), capturedView(), capturedStart(), capturedEnd(), capturedLength(), and QString::isNull().

Upstream PySide2 reference signatures (binding differences may apply):

captured(self, name: str) -> str
captured(self, nth: int=...) -> str

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#captured

capturedEnd

capturedEnd(name: Any) -> int

X.capturedEnd(name) -> int

Supplemental documentation: Qt 5 reference:

int QRegularExpressionMatch::capturedEnd(int nth \= 0) const

Returns the offset inside the subject string immediately after the ending position of the substring captured by the nth capturing group. If the nth capturing group did not capture a string or doesn't exist, returns -1.

See also capturedStart(), capturedLength(), and captured().

int QRegularExpressionMatch::capturedEnd(const QString \&name) const

Returns the offset inside the subject string immediately after the ending position of the substring captured by the capturing group named name. If the capturing group named name did not capture a string or doesn't exist, returns -1.

See also capturedStart(), capturedLength(), and captured().

int QRegularExpressionMatch::capturedEnd(QStringView name) const

Returns the offset inside the subject string immediately after the ending position of the substring captured by the capturing group named name. If the capturing group named name did not capture a string or doesn't exist, returns -1.

This function was introduced in Qt 5.10.

See also capturedStart(), capturedLength(), and captured().

Upstream PySide2 reference signatures (binding differences may apply):

capturedEnd(self, name: str) -> int
capturedEnd(self, nth: int=...) -> int

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#capturedEnd

capturedLength

capturedLength(name: Any) -> int

X.capturedLength(name) -> int

Supplemental documentation: Qt 5 reference:

int QRegularExpressionMatch::capturedLength(int nth \= 0) const

Returns the length of the substring captured by the nth capturing group.

Note: This function returns 0 if the nth capturing group did not capture a string or doesn't exist.

See also capturedStart(), capturedEnd(), and captured().

int QRegularExpressionMatch::capturedLength(const QString \&name) const

Returns the length of the substring captured by the capturing group named name.

Note: This function returns 0 if the capturing group named name did not capture a string or doesn't exist.

See also capturedStart(), capturedEnd(), and captured().

int QRegularExpressionMatch::capturedLength(QStringView name) const

Returns the length of the substring captured by the capturing group named name.

Note: This function returns 0 if the capturing group named name did not capture a string or doesn't exist.

This function was introduced in Qt 5.10.

See also capturedStart(), capturedEnd(), and captured().

Upstream PySide2 reference signatures (binding differences may apply):

capturedLength(self, name: str) -> int
capturedLength(self, nth: int=...) -> int

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#capturedLength

capturedRef

capturedRef(name: Any) -> str

X.capturedRef(name)

Supplemental documentation: Qt 5 reference:

QStringRef QRegularExpressionMatch::capturedRef(int nth \= 0) const

Returns a reference to the substring captured by the nth capturing group.

If the nth capturing group did not capture a string, or if there is no such capturing group, returns a null QStringRef.

Note: The implicit capturing group number 0 captures the substring matched by the entire pattern.

See also captured(), capturedView(), lastCapturedIndex(), capturedStart(), capturedEnd(), capturedLength(), and QStringRef::isNull().

QStringRef QRegularExpressionMatch::capturedRef(const QString \&name) const

Returns a reference to the string captured by the capturing group named name.

If the named capturing group name did not capture a string, or if there is no capturing group named name, returns a null QStringRef.

See also captured(), capturedView(), capturedStart(), capturedEnd(), capturedLength(), and QStringRef::isNull().

QStringRef QRegularExpressionMatch::capturedRef(QStringView name) const

Returns a reference to the string captured by the capturing group named name.

If the named capturing group name did not capture a string, or if there is no capturing group named name, returns a null QStringRef.

This function was introduced in Qt 5.10.

See also captured(), capturedView(), capturedStart(), capturedEnd(), capturedLength(), and QStringRef::isNull().

Upstream PySide2 reference signatures (binding differences may apply):

capturedRef(self, name: str) -> str
capturedRef(self, nth: int=...) -> str

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#capturedRef

capturedStart

capturedStart(name: Any) -> int

X.capturedStart(name) -> int

Supplemental documentation: Qt 5 reference:

int QRegularExpressionMatch::capturedStart(int nth \= 0) const

Returns the offset inside the subject string corresponding to the starting position of the substring captured by the nth capturing group. If the nth capturing group did not capture a string or doesn't exist, returns -1.

See also capturedEnd(), capturedLength(), and captured().

int QRegularExpressionMatch::capturedStart(const QString \&name) const

Returns the offset inside the subject string corresponding to the starting position of the substring captured by the capturing group named name. If the capturing group named name did not capture a string or doesn't exist, returns -1.

See also capturedEnd(), capturedLength(), and captured().

int QRegularExpressionMatch::capturedStart(QStringView name) const

Returns the offset inside the subject string corresponding to the starting position of the substring captured by the capturing group named name. If the capturing group named name did not capture a string or doesn't exist, returns -1.

This function was introduced in Qt 5.10.

See also capturedEnd(), capturedLength(), and captured().

Upstream PySide2 reference signatures (binding differences may apply):

capturedStart(self, name: str) -> int
capturedStart(self, nth: int=...) -> int

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#capturedStart

capturedTexts

capturedTexts() -> tuple

X.capturedTexts() -> tuple

Supplemental documentation: Qt 5 reference:

QStringList QRegularExpressionMatch::capturedTexts() const

Returns a list of all strings captured by capturing groups, in the order the groups themselves appear in the pattern string. The list includes the implicit capturing group number 0, capturing the substring matched by the entire pattern.

Upstream PySide2 reference signatures (binding differences may apply):

capturedTexts(self) -> typing.List[str]

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#capturedTexts

hasMatch

hasMatch() -> bool

X.hasMatch() -> bool

Supplemental documentation: Qt 5 reference:

bool QRegularExpressionMatch::hasMatch() const

Returns true if the regular expression matched against the subject string, or false otherwise.

See also QRegularExpression::match() and hasPartialMatch().

Upstream PySide2 reference signatures (binding differences may apply):

hasMatch(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#hasMatch

hasPartialMatch

hasPartialMatch() -> bool

X.hasPartialMatch() -> bool

Supplemental documentation: Qt 5 reference:

bool QRegularExpressionMatch::hasPartialMatch() const

Returns true if the regular expression partially matched against the subject string, or false otherwise.

Note: Only a match that explicitly used the one of the partial match types can yield a partial match. Still, if such a match succeeds totally, this function will return false, while hasMatch() will return true.

See also QRegularExpression::match(), QRegularExpression::MatchType, and hasMatch().

Upstream PySide2 reference signatures (binding differences may apply):

hasPartialMatch(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#hasPartialMatch

isValid

isValid() -> bool

X.isValid() -> bool

Supplemental documentation: Qt 5 reference:

bool QRegularExpressionMatch::isValid() const

Returns true if the match object was obtained as a result from the QRegularExpression::match() function invoked on a valid QRegularExpression object; returns false if the QRegularExpression was invalid.

See also QRegularExpression::match() and QRegularExpression::isValid().

Upstream PySide2 reference signatures (binding differences may apply):

isValid(self) -> bool

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#isValid

lastCapturedIndex

lastCapturedIndex() -> int

X.lastCapturedIndex() -> int

Supplemental documentation: Qt 5 reference:

int QRegularExpressionMatch::lastCapturedIndex() const

Returns the index of the last capturing group that captured something, including the implicit capturing group 0. This can be used to extract all the substrings that were captured:

QRegularExpressionMatch match = re.match(string);
for (int i = 0; i <= match.lastCapturedIndex(); ++i) {
    QString captured = match.captured(i);
    // ...
}

Note that some of the capturing groups with an index less than lastCapturedIndex() could have not matched, and therefore captured nothing.

If the regular expression did not match, this function returns -1.

See also captured(), capturedStart(), capturedEnd(), and capturedLength().

Upstream PySide2 reference signatures (binding differences may apply):

lastCapturedIndex(self) -> int

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#lastCapturedIndex

matchOptions

matchOptions() -> Any

X.matchOptions()

Supplemental documentation: Qt 5 reference:

QRegularExpression::MatchOptions QRegularExpressionMatch::matchOptions() const

Returns the match options that were used to get this QRegularExpressionMatch object, that is, the match options that were passed to QRegularExpression::match() or QRegularExpression::globalMatch().

See also QRegularExpression::match(), regularExpression(), and matchType().

Upstream PySide2 reference signatures (binding differences may apply):

matchOptions(self) -> PySide2.QtCore.QRegularExpression.MatchOptions

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#matchOptions

matchType

matchType() -> Any

X.matchType()

Supplemental documentation: Qt 5 reference:

QRegularExpression::MatchType QRegularExpressionMatch::matchType() const

Returns the match type that was used to get this QRegularExpressionMatch object, that is, the match type that was passed to QRegularExpression::match() or QRegularExpression::globalMatch().

See also QRegularExpression::match(), regularExpression(), and matchOptions().

Upstream PySide2 reference signatures (binding differences may apply):

matchType(self) -> PySide2.QtCore.QRegularExpression.MatchType

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#matchType

operator_assign

operator_assign(match: Any) -> Any

X.operator_assign(match) -> PythonQt.QtCore.QRegularExpressionMatch

regularExpression

regularExpression() -> Any

X.regularExpression() -> PythonQt.QtCore.QRegularExpression

Supplemental documentation: Qt 5 reference:

QRegularExpression QRegularExpressionMatch::regularExpression() const

Returns the QRegularExpression object whose match() function returned this object.

See also QRegularExpression::match(), matchType(), and matchOptions().

Upstream PySide2 reference signatures (binding differences may apply):

regularExpression(self) -> PySide2.QtCore.QRegularExpression

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#regularExpression

swap

swap(other: Any) -> None

X.swap(other)

Supplemental documentation: Qt 5 reference:

void QRegularExpressionMatch::swap(QRegularExpressionMatch \&other)

Swaps the match result other with this match result. This operation is very fast and never fails.

Upstream PySide2 reference signatures (binding differences may apply):

swap(self, other: PySide2.QtCore.QRegularExpressionMatch) -> None

Source: https://doc.qt.io/archives/qt-5.15/qregularexpressionmatch.html#swap