回答編集履歴
1
追記
answer
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
1,2,3,4,5,6,7,,,'''
|
8
8
|
|
9
9
|
txt2 = re.sub(',[^,]*,[^,]*,[^,]*$', '', txt, flags=re.MULTILINE)
|
10
|
+
# 下記の正規表現でもよいです。
|
11
|
+
# txt2 = re.sub('(,[^,]*){3}$', '', txt, flags=re.MULTILINE)
|
10
12
|
|
11
13
|
print(txt2)
|
12
14
|
#1,2,3,4,5,6,7
|