tjoo... drum bin ich hier im forum gelandet um zu gucken ob da jemand mehr weiss als ich, was ich oft annehme, da ich mit RE zwar schon einige Zeit arbeite aber mich nicht als crack bezeichnen würd. dafür issn forum ja da.
übrigens... hab sie nun umgeschrieben
führt zu
Code: Alles auswählen
>>> text = '''"Value1;";"Value2";"""Value3""";"of ""very"" ""difficult""";"";"expressions"
"and";"";"we should not ;""then""; forget";"that it
works ;"
as ""ss""
expected""
"And";"this ""is""";" a";"new start"
"And2";"this is a";"new start as well"
"only "this" line";" is malformat;ted "with" quotes"'''
>>> ptest = re.compile(';(?=(?:[^"]*"[^"]*")*(?![^"]*"))')
>>> re.split(ptest,text)
['"Value1;"', '"Value2"', '"""Value3"""', '"of ""very"" ""difficult"""', '""', '"expressions"\n"and"', '""', '"we should not ;""then""; forget"', '"that it\nworks ;"\nas ""ss""\nexpected""\n"And"', '"this ""is"""', '" a"', '"new start"\n"And2"', '"this is a"', '"new start as well"\n"only "this" line"', '" is malformat;ted "with" quotes"']
funzt jetzt auch in python... jetzt bin ich schon nah dran bis auf
det muss doch zum knacken sein?