The very first example
Code: Select all
if (match.hasMatch()) {
QString number = match.captured(1); // first equals "35"
QString name = match.captured("name"); // name equals "Bob"
}
Code: Select all
if (match.hasMatch()) {
QString number = match.captured(1); // first equals "35"
QString name = match.captured("name"); // name equals "Bob"
}
In C++ default arguments are a value provided in a method or function declaration. The default value is automatically assigned by the compiler if the caller of the function does not provide a value for the argument.S QRegularExpressionMatch< S >::captured ( int index = 0 ) const
Every other place in the doc index=0 means that indexes start at zero.