Regex based code replacements