Skip to content

Instantly share code, notes, and snippets.

@vinirossa
Created October 11, 2021 19:19
Embed
What would you like to do?
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