title: Scanner is not working on StringBuilder
body: <p>I wrote a program that must take input from a file and extract only text from it while saving its contents into an array. My text file contents are:</p>
  
  <pre><code>There is some!text.written%in
  the FILE[That]=Have+to`be==separated????
  </code></pre>
  
  <p>And what I have tried to code is:</p>
  
  <pre><code>public static void main(String[] args) throws FileNotFoundException, IOException {
      BufferedReader file = new BufferedReader(new FileReader("mfile.txt"));
      List&lt;String&gt; list = new ArrayList();
      String str;
      StringBuilder filedata = new StringBuilder();
      Scanner toknizer = new Scanner(filedata.toString());
      while((str=file.readLine())!=null){
          filedata.append(str);
      }
      toknizer.useDelimiter("[^a-z]");
      while(toknizer.hasNext()){
          list.add(toknizer.next());
      }
      System.out.println(list);
  }
  </code></pre>
  
  <p>at this time I only want to extract text that is written in small alphabets. But the program is printing out an empty list. Debugging revealed that <code>toknizer.hasNext()</code> is returning false in <code>while(toknizer.hasNext())</code>.
  What is wrong? Am I using wrong regular expression? I got the idea of using <code>[^a-z]</code> from <a href="http://docs.oracle.com/javase/tutorial/essential/regex/char_classes.html" rel="nofollow">here</a>.</p>