Php – How to match specific pattern with regex in a serialised string
I have something like this a:2:{s:4:"Test";s:29:"asdf'a' ;"serialize here;?"!";s:5:"test2";a:1:{s:4:"Test";s:15:"serialize here!";}} and I want to make a regex in order to match both examples below: s:15:"serialize s:29:"asdf'a' ;"serialize How can I do that? I tried something like s:d+:".+?serialize But it doesn't work.