echo Enter usernameread $WORDif [[ $WORD =~ ^(Dale|Paul|Ray)$ ]]; then    echo $WORD is validelse    echo $WORD is invalidfi
Bash regex test not working
bash
The error is in read command, use read WORD instead of read $WORD.Check this:echo Enter usernameread WORDif [[ $WORD =~ ^(Dale|Paul|Ray)$ ]]; then    echo $WORD is validelse    echo $WORD is invalidfi