Re hallucinating APIs that don't exist - I find this with Golang sometimes. I wonder if it's because the training data doesn't just consist of all the docs and source code, but potentially feature proposals that never made it into the language.
Regexes are another area where I can't get much help from LLMs. If it's something common like a phone number, that's fine. But anything novel it seems to have trouble. It will spit out junk very confidently.