I'm trying to create a Regex expression to use with preg_replace() to replace a expression that's between two other expressions. The overall idea is:
$new = "stuff";
$original = /*see below*/;
$final = preg_replace('regex expression', $new, $original);
example of $original string:
(...)"dl cm = xxxx opop1 = XYZ opop3 = XXXXXXXXXXXX,XXXX,"thisisit" YYYY = z"(...)
example of the $final string:
(...)"dl cm = xxxx opop1 = XYZ opop3 = XXXXXXXXXXXX,XXXX,"stuff" YYYY = z"(...)
(The X's, Y's, Z's can be any character)
The expression must find the 'opop3 = XXXXXXXXXXXX,XXXX,"' then the following '"' and change the text inside this two delimiters.
I think that I found how to find the first delimiter
(opop3.=(.*)(\,)(.*)(\,)\")
And find the following '"' is not hard, but i don't know how can I change the text between them without touching the delimiters.
(or if someone know other way to do this, please, let me know)