title: Problem with groovy and regex matching groups
body: <p>I'm getting here after reading some other questions and examples like:</p>
  <p><a href="https://stackoverflow.com/questions/764387/groovy-syntax-for-regular-expression-matching">Groovy syntax for regular expression matching</a></p>
  <p><a href="https://stackoverflow.com/questions/7772497/groovy-regex-pattern-matching">Groovy regex/pattern matching</a></p>
  <p>Also this documentation I found online:
  <a href="https://e.printstacktrace.blog/groovy-regular-expressions-the-definitive-guide/" rel="nofollow noreferrer">https://e.printstacktrace.blog/groovy-regular-expressions-the-definitive-guide/</a></p>
  <p>I was playing with it and I have what I think is a very basic regex but by some reason I always get no match.</p>
  <p>So imagining I have a git url something like this:
  &quot;ssh://git@bitbucket.sits.net/project/repo.git&quot;</p>
  <p>I want to extract in my groovy pipeline the project and repo itself:
  &quot;ssh://git@bitbucket.sits.net/([a-zA-Z-<em>]*)/([a-zA-Z-</em>]*).git&quot; (maybe there are smarter ways of doing this match but still should work)</p>
  <p>Anyway the problem is that I'm testing this and at the moment I can't even make the simple ssh match, last alone my groups.
  It works fine in an online regex tester
  <a href="https://i.stack.imgur.com/rEOKx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rEOKx.png" alt="enter image description here" /></a></p>
  <p>But it does not work in the groovy playground online.</p>
  <p>This is the example (I'm testing it here <a href="https://groovy-playground.appspot.com/" rel="nofollow noreferrer">https://groovy-playground.appspot.com/</a>):</p>
  <p>This input:</p>
  <pre><code>GIT_URL='ssh://git@bitbucket.sits.net/project/repo.git'
  
  def match = GIT_URL =~ /ssh:\/\/git@bitbucket\.sits\.net\/([a-zA-Z-_]*)\/([a-zA-Z-_]*)\.git/
  
  println match 
  </code></pre>
  <p>Outputs no match:</p>
  <pre><code>java.util.regex.Matcher[pattern=ssh://git@bitbucket\.sits\.net/([a-zA-Z-_]*)/([a-zA-Z-_]*)\.git region=0,45 lastmatch=]
  </code></pre>
  <p>I've tried a few things but not even ssh match works</p>
  <pre><code>GIT_URL='ssh://git@bitbucket.sits.net/project/repo.git'
  
  def match = GIT_URL =~ /ssh/
  
  println match 
  java.util.regex.Matcher[pattern=ssh region=0,45 lastmatch=]
  </code></pre>
  <p>I thought it could be a problem in the tool but in my Jenkins pipeline it also does not work.</p>
  <p>Also the example from the other question:</p>
  <pre><code>def match2 = &quot;f1234&quot; =~ /[a-z]\d{4}/
  println match2
  java.util.regex.Matcher[pattern=[a-z]\d{4} region=0,5 lastmatch=]
  </code></pre>