bash

Bash Regexes

Test regex:

Date="90008000"

if [[ "$Date" =~ ^[0-9]{8}$ ]]; then
    echo "Valid date"
else
    echo "Invalid date"
fi

Inverse puts ! in front:

if [[ ! "$Date" =~ ^[0-9]{8}$ ]]; then