title: bash get a regular expression number up to 2 digits
body: <p>I simply need to know how to make a regex that accepts a number that has up to 2 digits</p>
  
  <p>All I have just now is </p>
  
  <pre><code>^[0-9]{2}$
  </code></pre>
  
  <p>Which would match a number with exactly 2 digits, but I don't know how to specify "match a number which has up to 2 digits".</p>
  
  <p>Also, if there is a way to make sure that this number isn't 0 then that would be a plus, otherwise I can check that with Bash.</p>
  
  <p>Thanks ! :)</p>
  
  <p>Note that the input variable comes from read -p "make a choice" Number</p>
  
  <p>EDITING MY POST - SHOWING CODE IN CONTEXT : </p>
  
  <pre><code>while true; do
      read -p "Please key in the number of the engineer of your choice, or leave empty to select them all: " Engineer
      if [ -z "$Engineer" ]; then
          echo "No particular user specified, all engineers will be selected."
          UserIdSqlString="Transactions.Creator!=0 "
          break
      else
          if [[ $Engineer =~ ^[0-9]{1,2}$ &amp;&amp; $Engineer -ne 0 ]]; then
              echo "If you want a specific engineer type their number otherwise leave blank"  
          else
              echo "yes"
              break
          fi
      fi
  done
  </code></pre>