title: The executed string value does not match to the hard coded value
body: <p>In my helper class i'm extracting a key string from a log file. In there im searching for a date and substring that text. The issue is when im including that date included phrase using java date and the hard coded ones are acting in different ways. </p>
  
  <p>The code snippet :</p>
  
  <pre><code>BufferedReader br = new BufferedReader(new FileReader("/developer.log"));
          StringBuilder sb = new StringBuilder();
          String line = br.readLine();
  
          while (line != null) {
              sb.append(line);
              line = br.readLine();
          }
  
        String second = sb.toString();
        String pattern = "yyyy-MM-dd";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat(pattern);
        String date = "]"+simpleDateFormat.format(new Date());
        Matcher m2 = Pattern.compile("^(.*)date(.*)$").matcher(second);
              if (m2.find()) {
                  String keyPrefix = "Bearer ";
                  key = keyPrefix + m2.group(1);
              }
          }
          br.close();
          return key;
  </code></pre>
  
  <p>The <code>date</code> variable does not return a pattern match but when i hard coded the string as <code>]2019-03-01</code> it works. What might be the problem here? Thanks in advance.</p>