Hi,

I have the following code, which should find all occorences of '_' which is followed by a number, and replace it with a '.' (dot).
But nothing is being replced...
I guess my QRegExp is wrong, but from reading the docs, I don't understand why...

Thanks.
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. //Q_INIT_RESOURCE(application);
  4.  
  5. QApplication app(argc, argv);
  6. QRegExp re("_(?=\d+)");
  7. QFile ifile("marquard.csv");
  8. QFile ofile("marqurd_new.cvs");
  9. ifile.open(QIODevice::ReadOnly);
  10. ofile.open(QIODevice::WriteOnly);
  11. QTextStream istream(&ifile);
  12. QTextStream ostream(&ofile);
  13. QString text;
  14. istream>>text;
  15. text.replace(re,".");
  16. ostream<<text;
  17. ifile.close();
  18. ofile.close();
  19. return app.exec();
  20. }
To copy to clipboard, switch view to plain text mode