diff --git a/rslib/src/findreplace.rs b/rslib/src/findreplace.rs index c1b0c0d66..fd31aae27 100644 --- a/rslib/src/findreplace.rs +++ b/rslib/src/findreplace.rs @@ -7,7 +7,7 @@ use regex::Regex; use crate::{ collection::Collection, - error::{AnkiError, Result}, + error::Result, notes::{NoteId, TransformNoteOutput}, prelude::*, text::normalize_to_nfc, @@ -35,7 +35,7 @@ impl FindReplaceContext { ) -> Result { Ok(FindReplaceContext { nids, - search: Regex::new(search_re).map_err(|_| AnkiError::invalid_input("invalid regex"))?, + search: Regex::new(search_re)?, replacement: repl.into(), field_name, })