Skip to content

Commit

Permalink
Adopt the last captured substring in extract_substr_idxes
Browse files Browse the repository at this point in the history
  • Loading branch information
SoraSuegami committed Dec 23, 2024
1 parent 9e1275e commit dc3aee3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/apis/src/extract_substrs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ pub fn extract_substr_idxes(

// Find the match for the entire regex
let entire_captures = entire_regex
.captures(input_str)
.map_err(|_| ExtractSubstrssError::SubstringOfEntireNotFound(entire_regex.clone()))?
.ok_or_else(|| ExtractSubstrssError::SubstringOfEntireNotFound(entire_regex.clone()))?;
.captures_iter(input_str)
.last()
.ok_or_else(|| ExtractSubstrssError::SubstringOfEntireNotFound(entire_regex.clone()))??;

let mut public_idxes = vec![];

Expand Down

0 comments on commit dc3aee3

Please sign in to comment.