Logo Search packages:      
Sourcecode: qt-x11-free version File versions

int QRegExp::match ( const QString str,
int  index = 0,
int *  len = 0,
bool  indexIsStart = TRUE 
) const

Attempts to match in str, starting from position index. Returns the position of the match, or -1 if there was no match.

The length of the match is stored in *len, unless len is a null pointer.

If indexIsStart is TRUE (the default), the position index in the string will match the start of string anchor, ^, in the regexp, if present. Otherwise, position 0 in str will match.

Use search() and matchedLength() instead of this function.

See also:
QString::mid() QConstString

Definition at line 3612 of file qregexp.cpp.

References matchedLength().

{
    int pos = search( str, index, indexIsStart ? CaretAtOffset : CaretAtZero );
    if ( len != 0 )
      *len = matchedLength();
    return pos;
}


Generated by  Doxygen 1.6.0   Back to index