- var_dump: documentation ( source)
- preg_match_all: documentation ( source)
<?php
$A='one\\"two'; echo strlen($A); var_dump($A);
$Input= 'zero:("),one:(\\"),two:(\\\\"),three:(\\\\\\"),four:(\\\\\\\\"),five:(\\\\\\\\\\"),six:(\\\\\\\\\\\\")';
preg_match_all( "/[^\\]*((\\{2})*)(['\"])(.)*\1/U", $Input, $Matches);
var_dump($Matches);