I have the following in my bash script:
if [ $YEAR_MONTH =~ ^[0-9]{4}-(0[1-9]|1[0-2])$] then echo "ERROR: Incorrct folder