I have a simple branch to match during circleci build, but for some reason it just won't match
echo $CIRCLE_BRANCH #this variable is "release-0.0.2"
if [[ $CIRCLE_BRANCH =~ ^release-\d+\.\d+\.\d+ ]]; then
echo "release branch"
elif [[ $CIRCLE_BRANCH == master ]]; then
echo "master branch"
fi
# Output
# release-0.0.2
I expect the echo "release branch"
to run, but ^release-\d+\.\d+\.\d+
doesn't seem to match release-v0.0.2
.
I have tested the regex in an online regex tool and it seems to be correct.
I also tried putting quotes and "/"s around the regex but still no luck