Extract dictionary key/value pairs using regex instead of string operations.