Regex patching and debug dict