質問するログイン新規登録

回答編集履歴

1

より必要とされている処理に近づける

2021/02/15 01:32

投稿

phoepsilonix
phoepsilonix

スコア233

answer CHANGED
@@ -8,6 +8,6 @@
8
8
 
9
9
  text = '【テスト】win\n・dow\n'
10
10
 
11
- result = re.sub(r'^(.*)(\n)(.*)$', r'\1\3', text)
11
+ result = re.sub(r'^(【テスト】)(.*)(\n)(.*)$', r'\1\2\4', text)
12
12
  print(result)
13
13
  ```