fork(8) download
  1. #!/bin/bash
  2. refname='refs/heads/XS-1141'
  3. re="[A-Z]+-[0-9]+"
  4. echo "checking if branch name contains a JIRA issue (format XX-1111, SRS-1 or similar)"
  5. if [[ $refname =~ $re ]]; then echo ${BASH_REMATCH[0]}; fi;
Success #stdin #stdout 0.01s 5460KB
stdin
Standard input is empty
stdout
checking if branch name contains a JIRA issue (format XX-1111, SRS-1 or similar)
XS-1141