I have this regex:
preg_replace(
'/\["'.$key.'"\] = (.+?);/is', '["'.$key.'"] = '.$newValue.';',
$contents);
It writes an array value in a config file. I need to allow single or double quotes around the array key and I'm not sure how to do that. I didn't write this regex.