I have text expressions something like as mentioned below. I want to filter only words with English alphabets (i.e no special chars, no operators, no quotes ...etc)

As an output, i expect words like this:


Input:

Buy 1 lakh SMS at 5p/SMS & Get 1lakh Data & keyword for 2 months free. Pay Rs.2000 more & Get a Dynamic 15 pages WebSite. Call 9811968238.
Output:

Buy lakh SMS at SMS Get lakh Data keyword for months free Pay Rs more Get Dynamic pages WebSite Call
Qt Code:
  1. QFile file("E:\\SMS\\dout.csv");
  2. file.open(QIODevice::ReadWrite | QIODevice::Text);
  3. QTextStream out(&file);
  4. out << "This file is generated by Qt\n\n\n";
  5.  
  6. QFile file2("E:\\SMS\\CCHECK.txt");
  7. file2.open(QIODevice::ReadWrite | QIODevice::Text);
  8. QTextStream cc_in(&file2);
  9.  
  10. QString chk_ln = cc_in.readLine();
  11.  
  12. while(!chk_ln.isNull())
  13. {
  14. //Problem in below line
  15. QStringList list2 = chk_ln.split(QRegExp("\\W+"), QString::SkipEmptyParts);
  16.  
  17. for (int i = 0; i < list2.size(); ++i)
  18. {
  19. out<<list2[i]<<" ";
  20.  
  21. }
  22. out<<"\n";
  23.  
  24. chk_ln = cc_in.readLine();
  25. }
To copy to clipboard, switch view to plain text mode 

Any help is appreciated !!