language: Python (python 2.7.3)
date: 548 days 14 hours ago
link:
visibility: private
1
2
3
4
5
6
7
8
9
text = '''"Value1", "Value2", "This is a longer piece
    of text with
    newlines in it.", "Value3"
"Value4", "Value5", "Another value", "value6"'''
 
import re
pattern = re.compile(r'".*?"', re.DOTALL)
print pattern.sub(lambda x: x.group().replace('\n', ''), text)