title: Bash scripting regular expressions
body: <p>I'm trying to match a version number from a string in the format 4.6, or 2.8.  I have the following which I will eventually use in a function in my .bashrc file to find the OS version:</p>
  
  <pre><code>function test () {
      string="abc ABC12 123 3.4 def";
      echo `expr match "$string" '[0-9][.][0-9]'`
  }
  </code></pre>
  
  <p>However, this doesn't match the 3.4 in the string.  Can anyone point me in the right direction here?</p>
  
  <p>Thanks.</p>