title: How to match digits in regex in bash script
body: <p>I'm trying to match some lines against regex that contains digits.</p>
  
  <p>Bash version 3.2.25:</p>
  
  <pre><code>#!/bin/bash
  
  s="AAA (bbb 123) CCC"
  regex="AAA \(bbb \d+\) CCC"
  if [[ $s =~ $regex ]]; then
    echo $s matches $regex
  else
    echo $s doesnt match $regex
  fi
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>AAA (bbb 123) CCC doesnt match AAA \(bbb \d+\) CCC
  </code></pre>
  
  <p>If I put <code>regex="AAA \(bbb .+\) CCC"</code> it works but it doesn't meet my requirement to match digits only.</p>
  
  <p>Why doesn't <code>\d+</code> match <code>123</code>?</p>