Here's an example from the docs:
Qt Code:
  1. QString str = "offsets: 1.23 .50 71.00 6.00";
  2. QRegExp rx( "\\d*\\.\\d+" ); // primitive floating point matching
  3. int count = 0;
  4. int pos = 0;
  5. while ( (pos = rx.search(str, pos)) != -1 ) {
  6. count++;
  7. pos += rx.matchedLength();
  8. }
  9. // pos will be 9, 14, 18 and finally 24; count will end up as 4
To copy to clipboard, switch view to plain text mode 
You need something similar. QRegExp::cap( 0 ) should return the whole matched tag.