diff --git a/libimagbookmark/src/collection.rs b/libimagbookmark/src/collection.rs index bdee34a2..bd6b8b22 100644 --- a/libimagbookmark/src/collection.rs +++ b/libimagbookmark/src/collection.rs @@ -103,8 +103,16 @@ impl<'a> BookmarkCollection<'a> { .map_err_into(BEK::LinkError) } - pub fn get_links_matching(&self, r: Regex) -> Result { - unimplemented!() + pub fn get_links_matching(&self, r: Regex) -> Result> { + self.get_external_links(self.store) + .map_err_into(BEK::LinkError) + .map(|v| { + v.into_iter() + .map(Url::into_string) + .filter(|urlstr| r.is_match(&urlstr[..])) + .map(Link::from) + .next() + }) } pub fn remove_link(&self, l: Link) -> Result<()> {