Skip to content

Instantly share code, notes, and snippets.

@vinirossa
Created October 11, 2021 19:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vinirossa/b6241b32d80576aeb495bebd4baf37ad to your computer and use it in GitHub Desktop.
Save vinirossa/b6241b32d80576aeb495bebd4baf37ad to your computer and use it in GitHub Desktop.
commitMessages=(one "two afd-d" three "Merge branch 'main'")
commitRegex="^Merge branch '.*'$"
for i in "${commitMessages[@]}"
do
if [[ $i =~ $commitRegex ]]
then
echo "Correct"
else
echo "Incorrect"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment