title: Bash completion doesn't work for MSYS bash. Regex syntax error
body: <p>I tried to install bash-completion for MSYS bash, but it seems it contains some syntax errors.
  It fails with the following message</p>
  
  <pre><code>bash: /usr/local/share/bash-completion/bash_completion: line 625: syntax error in conditional expression: unexpected token `('
  bash: /usr/local/share/bash-completion/bash_completion: line 625: syntax error near `^(\'
  bash: /usr/local/share/bash-completion/bash_completion: line 625: `    if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then'
  </code></pre>
  
  <p>here is the code that fails</p>
  
  <pre><code># Complete variables.
  # @return  True (0) if variables were completed, 
  #          False (&gt; 0) if not.
  _variables()
  {
      if [[ $cur =~ ^(\$\{?)([A-Za-z0-9_]*)$ ]]; then
          [[ $cur == *{* ]] &amp;&amp; local suffix=} || local suffix=
          COMPREPLY+=( $( compgen -P ${BASH_REMATCH[1]} -S "$suffix" -v -- \
              "${BASH_REMATCH[2]}" ) )
          return 0
      fi
      return 1
  }
  </code></pre>