title: Extract string in jenkins pipeline(groovy)
body: <p>I have a string like "AAA_revision12" and I have to extract the substring before "_" for example "AAA". I tried some regexps, but they doesn't work in jenkins.</p>
  
  <pre><code>String stringParser(String inputString) {
      inputString ? inputString.split(/_\d/)[0] : ''
  }
  
  $string = "AAA revision".split('-')
  
  assert string[0]
  </code></pre>