Quote Originally Posted by tuthmosis View Post
Sorry but i had my reasons to ask... I know regexp, no need to insult me.
If i ask it's because normal regexp don't seam to be compatible with QRegExp.
Well you didn't ask the following in the first time!
For my need, the following should work.
(?<=<TH>)([a-zA-Z0-9 ])+(?=</TD>)

Applied to <TH>test</TD> ... this pattern will return <TH>test... so the backward lookup doesn't seem to be implemented.
Yes, not all is implemented, but one can achieve all with some extra work.
Qt Code:
  1. QString str = "<TH>test</TD> foo <TH>bar</TD>";
  2. QRegExp rx("<TH>([a-zA-Z0-9 ]+)</TD>");
  3. int pos = 0;
  4. while ((pos = rx.indexIn(str, pos)) != -1)
  5. {
  6. list << rx.cap(1);
  7. pos += rx.matchedLength();
  8. }
  9. qWarning() << list; // ("test", "bar")
To copy to clipboard, switch view to plain text mode