<?php

$re = "/(?s)'(?:[^'\\\\]|\\\\.)*'|\"(?:[^\"\\\\]|\\\\.)*\"/"; 
$str = "\"string 'c' \\\" string \\\" \" and ' string \"ste\" \\' '"; 
preg_match_all($re, $str, $matches);
print_r($matches);