title: Regex not working with Stream filter()
body: <p>I am trying to get certain text out from a line that I get when using the new <code>Stream</code> in Java 8.</p>
  
  <p>This is what I am reading in:</p>
  
  <pre><code>46 [core1]
  56 [core1]
  45 [core1]
  45 [core2]
  67 [core2]
  54 [core2]
  </code></pre>
  
  <p>And here is the code I read it with currently:</p>
  
  <pre><code>Path path = Paths.get("./src/main/resources/", "data.txt");
              try(Stream&lt;String&gt; lines = Files.lines(path)){
                  List&lt;Integer&gt; temps = new ArrayList&lt;&gt;();
                  lines
                          .filter(line -&gt; line.contains("[core1]"))
                          .filter(line -&gt; line.contains("(\\d+).*"))
                          .flatMapToInt(temperature -&gt; IntStream.of(Integer.parseInt(temperature)))
                          .forEach(System.out::println);
                  System.out.print(temps.size());
              }
  </code></pre>
  
  <p>I have checked the regex expression in <a href="https://www.regex101.com/" rel="noreferrer">https://www.regex101.com/</a> and it seems to work fine.
  Also if I just search for the <code>[core1]</code> string, it will find it.</p>
  
  <p>The problem is that when using all of this together, I get 0 matches.
  My logic behind this currently is that I read a line, see what core it is, and then get it's number before it. After that I want to add it to a List.</p>
  
  <p>What am I doing wrong here?</p>