回答編集履歴

1

^

2018/05/04 15:55

投稿

gingertail
gingertail

スコア317

test CHANGED
@@ -1,8 +1,8 @@
1
1
  ```python
2
2
 
3
- pattern1 = re.compile(r'image_[0-9]{1}.jpg$')
3
+ pattern1 = re.compile(r'^image_[0-9]{1}.jpg$')
4
4
 
5
- pattern2 = re.compile(r'image-cv[0-9]{2}.jpg$')
5
+ pattern2 = re.compile(r'^image-cv[0-9]{2}.jpg$')
6
6
 
7
7
  comp_files = sorted([file for file in files if pattern1.match(file)])[-1:] + [file for file in files if pattern2.match(file)]
8
8