title: Jenkins pipeline regex not matching anything
body: <p>I've got a regex with sample text <a href="https://regex101.com/r/WA7vQh/1" rel="noreferrer">that is working on regex101</a>, but doesn't seem to work in my Jenkins pipeline scenario. So I'm assuming I've got a mistake in my pipeline script, but I fail to see where.</p>
  
  <p>Here's a repro:</p>
  
  <pre class="lang-groovy prettyprint-override"><code>pipeline {
      agent any
  
      stages {
          stage ('Test') {
              steps {
                  script {
                      echo ("Test")
  
                      output = "Some text. \n\n 12 scenarios (3 failed, 2 success) plus text \n\n and some more text"
                      def hasSummaryMatch = (output ==~ /\d+ scenarios \([^()]+\)/)
  
                      echo ("hasSummaryMatch = " + hasSummaryMatch)
  
                      if (!hasSummaryMatch) {
                          error ("No summary!")
                      }
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>I've tested this with Jenkins 2.60.2 running in the official Docker container.</p>
  
  <p>This provides the following (abbreviated) output:</p>
  
  <pre class="lang-none prettyprint-override"><code>Started by user Administrator
  Running on master in /var/jenkins_home/workspace/Test001
  Test
  hasSummaryMatch = false
  ERROR: No summary!
  Finished: FAILURE
  </code></pre>
  
  <p>The expected output is <em>no error</em> because there should be a match.</p>
  
  <p>What am I doing wrong?</p>