In the case where tried to install a file:
sudo apt-get install libstdc++.so.6
instead of a package. You get the error message:
E: Unable to locate package libstdc++.so.6
E: Couldn't find any package by regex 'libstdc++.so.6'
because you tried to install a file
libstdc++.so.6 that you can't install, because it is located in a debian package.
You can use
apt-file to search for the package that contains that file. To install it, type:
sudo apt-get install apt-file
Then you have to update the index.
sudo apt-file update
After that, you can search for the package which contains the file
sudo apt-file find libstdc++.so.6
Then you find a lot packages that contains the searched file. For this example I paste only one search result:
Then you can install the needed package
sudo apt-get install libstdc++6