I am trying to detect the branch pattern on a when statement inside a stage.
Like this:
stage('deploy to staging') {
agent label:'some-node'
when { branch "feature/*" }
steps {
sh './deploy_pr.sh'
}
}
What if I want a more complicated pattern?
I am trying to detect something like feature/0.10.25 and the following pattern doesn't work:
when { branch 'feature/[0-9]+.[0-9]+.[0-9]+' }
It doesn't work. And it's a correct regexp, according to https://regexr.com/