input: Write a function to construct a Bash script that can install a given software. The function should take the software version as input and return the complete Bash script as a string. If the input is invalid (e.g., empty or not a valid version), the function should return an empty string.
  assert install_software("Python 3.8.5")=="""#!/bin/bash
  
  # Download latest version of Python
  curl -O https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz
  
  # Extract the tgz file
  tar -xzf Python-3.8.5.tgz
  
  # Move into the Python directory
  cd Python-3.8.5
  
  # Run the configure script
  ./configure
  
  # Compile and install
  make
  make install
  """
  assert install_software("Java 11")==""
  assert install_software("Python 3.8.5.1")==""
  assert install_software("")==""
output: def install_software(version):
      if not version or not re.match(r"^[A-Za-z]+\s\d+(\.\d+)*$", version):
          return ""
      software, ver = version.split(' ', 1)
      if software.lower() == "python":
          return f"""#!/bin/bash
  
  # Download latest version of Python
  curl -O https://www.python.org/ftp/python/{ver}/Python-{ver}.tgz
  
  # Extract the tgz file
  tar -xzf Python-{ver}.tgz
  
  # Move into the Python directory
  cd Python-{ver}
  
  # Run the configure script
  ./configure
  
  # Compile and install
  make
  make install
  """
      return ""