Your first regex is good, but only working for c variable, this is a variation working for all three variables:
[ces]=([^;]+);
that will look for your c , e and s variables.
In PHP you could execute it like this:
$string = 'c=VAR1; e=VAR2; s=VAR3;';
preg_match_all("/([ces])=([^;]+);/", $string, $out, PREG_PATTERN_ORDER);
$tot = count($out[1]);
for ($i=0;$i<$tot;$i++) {
echo $out[1][$i]; //will echo 'c' , 'e' , 's' respectively
echo $out[2][$i]; //will echo 'VAR1' , 'VAR2' , 'VAR3' respectively
}
Update: Answer to a OP's question in comments
The above loop is for dinamically assign the values found, so if the regex found 4 , 5 or 10 vars the for will loop all of them. But if you are sure your string has only 3 vars in it, you could assign them directly in one go, like this:
$string = 'c=VAR1; e=VAR2; s=VAR3;';
preg_match_all("/([ces])=([^;]+);/", $string, $out, PREG_PATTERN_ORDER);
$$out[1][0] = $out[2][0]; // var $c is created with VAR1 value
$$out[1][1] = $out[2][1]; // var $e is created with VAR1 value
$$out[1][2] = $out[2][2]; // var $s is created with VAR1 value
echo $c; //will output VAR1
echo $e; //will output VAR2
echo $s; //will output VAR3
I'm using PHP variable variables in above code.