title: How to specify the QString::indexOf method not to be sensitive to the number of spaces between two words?
body: <p>I have written a source code like:</p>
  
  <pre><code>int main(int argc, char *argv[]) {
      QFile File (directory + "/File");
  
          if(File.open(QIODevice::ReadOnly | QIODevice::Text))
          {
           QTextStream Stream (&amp;File);
           QString FileText;
             do
              {
        FileText = Stream.readLine();
      QString s = "start";
      QString e = "end   here";
      int start = FileText.indexOf(s, 0, Qt::CaseInsensitive); 
      int end = FileText.indexOf(e, Qt::CaseInsensitive); 
  
      if(start != -1){ // we found it
  
          QString y = FileText.mid(start + s.length(), (end - (start + s.length()))); 
  
          qDebug() &lt;&lt; y &lt;&lt; (start + s.length()) &lt;&lt; (end - (start + s.length()));
      }
  </code></pre>
  
  <p>}</p>
  
  <p>My problem here is, that the int end = FileText.indexOf(e, Qt::CaseInsensitive);
  with <code>QString e = "end   here";</code> is just found when there are exactly three spaces between the word "end" and "here". This is problematical, because in the text I read the spaces between these two words will surely differ from time to time. Furthermore I need to write both words "end" and "here". I tried to reduce the problem to the basis and hope someone has an idea/solution.</p>