title: Regular Expression in Bash Script
body: <p>Hello awesome community,</p>
  
  <p>I'm a complete dope when it comes to regex. I've put off learning it.. and now my laziness has caught up with me.</p>
  
  <p>What I'm trying to do:<br />
  Check if a string matches this format:</p>
  
  <pre><code>10_06_13
  </code></pre>
  
  <p>ie. Todays date, or a similar date with "2digits_2digits_2digits"</p>
  
  <p>What I've done:<br/></p>
  
  <pre><code>regex='([0-9][0-9][_][0-9][0-9][_][0-9][0-9])'
  if [[ "$incoming_string" =~ $regex ]]
  then
     # Do awesome stuff here
  fi
  </code></pre>
  
  <p>This works to a certain extent. But when the incoming string equals <code>011_100_131</code> ... it still passes the regex check.</p>
  
  <p>I'd be grateful if anyone could help point me in the right direction.<br/>
  Cheers</p>