<?php$s = "'abc', 'def', 'ghf\\\\', 'jkl\'f'";echo "$s\n";if (preg_match_all("~'.*?(?<!(?:(?<!\\\\)\\\\))'~", $s, $arr)) var_dump($arr[0]);?>
Standard input is empty
'abc', 'def', 'ghf\\', 'jkl\'f' array(4) { [0]=> string(5) "'abc'" [1]=> string(5) "'def'" [2]=> string(7) "'ghf\\'" [3]=> string(8) "'jkl\'f'" }
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!