There's no Programmers Stack Exchange site anymore. It has been replaced to Software Engineering and its URL is 'softwareengineering.stackexchange.com' which is already caught by the regex.
The Bitcoin site's URL is 'bitcoin.stackexchange.com' and not 'bitcoin.com', therefore it is already caught by that regex.
Mathoverflow is a special site, but it doesn't end in '.com', but in '.net', therefore it is moved to the second alternative
Positive lookahead is added to '.com' because the function is called to get the site name to use it in the API and API doesn't require '.com' at the end of sitenames. However, API doesn't accept 'meta.mathoverflow', but only 'meta.mathoverflow.net', so '.net' in second alternative doesn't have (?=).
The userscript, before, automatically added the prefix 'meta.' to every site to make an API call with it being the sitename. However, that's not true for non-special sites, where the 'meta' should come after the name and before the 'stackexchange'.
Since API also accepts the name of the site + the meta prefix, here, we replace 'stackexchange' with 'meta' instead of having more complex ways to add it after the name and before 'stackexchange'. If it is a special site, add naturally the 'meta.' prefix.
The userscript, before, automatically added the prefix 'meta.' to every site to make an API call with it being the sitename. However, that's not true for non-special sites, where the 'meta' should come after the name and before the 'stackexchange'.
Since API also accepts the name of the site + the meta prefix, here, we replace 'stackexchange' with 'meta' instead of having more complex ways to add it after the name and before 'stackexchange'. If it is a special site, add naturally the 'meta.' prefix.