I have a loop that evaluates based on a regex conditional:
until read -p "Enter oprator: " operator
[[ $operator =~ ^[+-*\/]$ ]] #doesn't work
do...
The loop will run until the user enters an arithmetic operator (+, -, * or /). When I enter any of those four, the loop still runs.
I've tried variations of this (i.e. place regex in variable, using quotes, grep) but nothing seems to work.