According to ''help read'' we can specify -N[chars] to trigger return automatically. Is it possible to approach read differently?
For example: $re is some regular _expression_
read -N$re -p "Enter two or three digits to continue " getInput
The above is much of a pseudo-code but I hope you get the idea.
-N in this case should be able to handle a range of 2 or 3 chars. If the regex is satisfied then return should be triggered after 2 chars otherwise wait for the third char.