回答編集履歴
1
追記
answer
CHANGED
@@ -1,4 +1,10 @@
|
|
1
1
|
splitで区切り文字を残す方法も有りますが、findall使った方が楽そうです。
|
2
2
|
```Python
|
3
3
|
dst = re.findall(r'[^-]+-[0-9]+', 文字列)
|
4
|
+
```
|
5
|
+
|
6
|
+
複数行一気に処理するなら、事前に空白文字を潰します。
|
7
|
+
```Python
|
8
|
+
src = src.strip()
|
9
|
+
src = ''.join(src.split())
|
4
10
|
```
|