Skip to content

Commit a85fb6f

Browse files
committed
icu4x-datagen: make attribute filtering anchored
1 parent 0177c42 commit a85fb6f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

provider/icu4x-datagen/src/main.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ impl FromStr for Filter {
7676
let regex = regex.strip_prefix('/').ok_or(FilterError::NoOpeningSlash)?;
7777
let regex = regex.strip_suffix('/').ok_or(FilterError::NoClosingSlash)?;
7878

79-
let regex = Regex::new(regex)?;
79+
// add an implicit `^(?:)$` around the regex
80+
let regex = format!("^(?:{})$", regex);
81+
let regex = Regex::new(&regex)?;
8082

8183
Ok(Filter {
8284
domain: domain.to_owned(),

0 commit comments

Comments
 (0)