Skip to content

Commit 7ae60a1

Browse files
committed
support for market_id as suffix, not just whole filename
1 parent d62bf63 commit 7ae60a1

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/files.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,17 @@ use crate::mutable::file::File as MutFile;
2727
const NUM_BUFFERED: usize = 50;
2828

2929
static MID_RXP: SyncOnceCell<Regex> = SyncOnceCell::new();
30+
// does the filename end in market_id
31+
// resources/PRO-1.170258213 == true
32+
// resources/1.170258213 == true
33+
// resources/.gitignore == false
3034
fn is_filename_marketid(p: &Path) -> bool {
3135
p.file_name()
3236
.map(|name| {
3337
let name = name.to_string_lossy();
3438

3539
MID_RXP
36-
.get_or_init(|| Regex::new(r"^\d{1}.\d{9}$").unwrap())
40+
.get_or_init(|| Regex::new(r"^.*\d{1}.\d{9}$").unwrap())
3741
.is_match(&name)
3842
})
3943
.unwrap_or(false)

0 commit comments

Comments
 (0)