Implement the regex_dict function that transforms keys within a dictionary from wildcard formats (e.g. "*.cpp") into their equivalent regex patterns while retaining the associated values. The function should take a single argument, item, which must be a dictionary where keys are strings with potential wildcards and values can be of any type. The function will convert only the keys and return a new dictionary with the regex keys and unchanged values.
Input/Output Behavior:
Input: A dictionary like {'*.cpp': {'a': 'arf', 'b': 'bark'}}
Output: A dictionary where the keys are regex patterns (e.g. {'^.*\\.cpp$': {'a': 'arf', 'b': 'bark'}}).
Edge Cases:
An empty dictionary should return an empty dictionary.
Handling of keys with no wildcards (e.g., {'file.cpp': 'content'} should remain as {'file\\.cpp': 'content'}).
Ensure the function works with various data types as values (e.g., lists, strings, nested dictionaries).
Handle special regex characters in keys appropriately (e.g., a key with a dot or asterisk).
Note: The solution should be placed in /app/solution.py. The function must be importable as: from solution import regex_dict