看下这个函数
nt QString::indexOf ( const QRegExp & rx, int from = 0 ) const
This function overloads indexOf().
Returns the index position of the first match of the regular expression rx in the string, searching forward from index position from. Returns -1 if rx didn't match anywhere.
Example:
QString str = "the minimum";
str.indexOf(QRegExp("m[aeiou]"), 0); // returns 4
QRegExp里可以用正则