Ben kaçan tek tırnak için izin, bana çok uzun virgül tek tırnak içinde yok yok gibi, virgülle bir dize bölmek sağlayacak PHP 5 preg_match_all kullanarak bir düzenli ifade için arıyorum. Örnek veriler olacaktır:
(some_array, 'some, string goes here','another_string','this string may contain "double quotes" but, it can\'t split, on escaped single quotes', anonquotedstring, 83448545, 1210597346 + '000', 1241722133 + '000')
Bu şuna benzer bir maç üretmek gerekir:
(some_array
'some, string goes here'
'another_string'
'this string may contain "double quotes" but, it can\'t split, on escaped single quotes'
anonquotedstring
83448545
1210597346 + '000'
1241722133 + '000')
Doğru% 100 uyuşmuyor rağmen ben pek çok, pek Regexes denedim ... Benim şu anki biri, bu gibi görünüyor. (Hala tek tırnak içinde bazı virgül böler.)
"/'(.*?)(?<!(?<!\\\)\\\)'|[^,]+/"