(text: &str, pattern: &str)
| 37 | } |
| 38 | |
| 39 | fn extract_candidate_codes(text: &str, pattern: &str) -> Vec<(String, usize)> { |
| 40 | let re = Regex::new(pattern).unwrap(); |
| 41 | let mut candidates = Vec::new(); |
| 42 | |
| 43 | for result in re.find_iter(text) { |
| 44 | if let Ok(mat) = result { |
| 45 | let code = mat.as_str(); |
| 46 | if code.chars().any(|c| c.is_ascii_digit()) { |
| 47 | let pos = mat.start(); |
| 48 | candidates.push((code.to_string(), pos)); |
| 49 | } |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | candidates |
| 54 | } |
| 55 | |
| 56 | fn filter_candidates_step1(candidates: Vec<(String, usize)>, _text: &str) -> Vec<(String, usize)> { |
| 57 | let mut filtered = Vec::new(); |
no test coverage detected