title: How can I extract only the text (stripping out timecodes) from SubRip .srt files?
body: <p>I'd like to use text only from a subtitle for further processing.</p>
  
  <p>So, opening a srt file would load this</p>
  
  <pre class="lang-none prettyprint-override"><code>1
  00:00:10,500 --&gt; 00:00:13,000
  Elephant's Dream
  
  2
  00:00:15,000 --&gt; 00:00:18,000
  At the left we can see...
  </code></pre>
  
  <p>Then, after stripping/extracting, the result would be</p>
  
  <pre class="lang-none prettyprint-override"><code>Elephant's Dream
  At the left we can see...
  </code></pre>
  
  <p>I want to strip out all the numbering and timecode, so the output would consist only of plain text in the exact same order as the original subtitle, and store the result in a variable for further processing.</p>
  
  <pre><code>public void open_file()
  {
      JFileChooser filechooser = new JFileChooser();
      filechooser.setFileSelectionMode(JFileChooser.FILES_ONLY);
      int i  = filechooser.showOpenDialog(this);
      if (i == filechooser.CANCEL_OPTION)
          return;
      File OpenFile = filechooser.getSelectedFile();
      if (OpenFile  == null || OpenFile.getName().equals(""))
      {
          JOptionPane.showMessageDialog(this, "choose file", "Error", JOptionPane.ERROR_MESSAGE);
          return;
      }
      try {
          BufferedReader bufferedreader = new BufferedReader(new FileReader(BukaFile));
          StringBuffer stringbuffer = new StringBuffer();
          String Row;
          while ((Row = bufferedreader.readLine()) != null) stringbuffer.append(Row+"\n");
          textArea.setText(stringbuffer.toString());
          String SubText = textArea.getText();
      } catch (FileNotFoundException ex) {
           JOptionPane.showMessageDialog(null, "File not found" + ex);
      } catch (IOException ex)
              {
                  JOptionPane.showMessageDialog(null, "IO Error"+ ex);
              }
  }
  </code></pre>
  
  <p>I've made a method (as above) to open and load an existing srt file and put it into a String (named SubText above) variable.</p>
  
  <p>To extract those texts, all I know is that I have to use either numberings, timecodes, and blank space for start point and end point, but I have no idea on how to code for detecting those numberings and timecodes in the text.</p>
  
  <p>How should I accomplish this in java? I'm using Netbeans, by the way.</p>