我想驗證用戶輸入正則表達式和輸入驗證猛砸
if ! [[ "$operator" =~ ("[+-/*]") ]] ; then # validate user input to include decimals
exec >&2; echo "error: Not a valid number, please try again";
echo
else
break
echo
fi
試過無數的組合,而不是工作? Ypu的幫助將不勝感激!
你想接受的數字,作爲註釋,輸出暗示,或運營商,如正則表達式的暗示? – Thomas