I am trying to replace all the in a json string with a double pipe ||. Here is an example of a string :
{"comment":"test1
test2
test3"}';
Here is the regex I have done :
preg_match('/"comment":"(([^
\t"]*)([
\t]*))+"/', $a, $t);
The result of this preg_match is
Array
(
[0] => "comment":"test1
test2
test3"
[1] =>
[2] =>
[3] =>
)
I can't find what is wrong with my regexp.
Do I need a recursive pattern (?R) ?
Thanks.