title: Regular expression["0-9"] issue in java
body: <p>I have a text file as follows:</p>
  
  <hr>
  
  <pre><code>Title
  XYZ
  Id name
  1  abc
  2  pqr
  3  xyz
  </code></pre>
  
  <hr>
  
  <p>I need to read the content starting with the integer value and I used the regular expression as in the following code.</p>
  
  <pre><code>public static void main(String[] args) throws FileNotFoundException {
     FileInputStream file= new FileInputStream("C:\\Users\\ap\\Downloads\\sample1.txt"); 
     Scanner scanner = new Scanner(file);
            while (scanner.hasNextLine()) {
              String line = scanner.nextLine();
              if (line.startsWith("[0-9]")) {
                  System.out.println("Line: "+line);
              }
             }
  }
  </code></pre>
  
  <p>The above code can't detect the lines starting with integers. However, it works fine if single integer values are passed to <code>startsWith()</code> function.
  Please suggest, where I went wrong.</p>