| 130 | } |
| 131 | |
| 132 | fn parse_log(log: &str) -> Option<(String, String, i32, String)> { |
| 133 | let re = Regex::new(r"(?s)\[(.*?)\]<(.*?)::(\d+)> (.*)").unwrap(); |
| 134 | if let Some(captures) = re.captures(log) { |
| 135 | let first_string = captures.get(1)?.as_str().to_string(); |
| 136 | let second_string = captures.get(2)?.as_str().to_string(); |
| 137 | let number: i32 = captures.get(3)?.as_str().parse().ok()?; |
| 138 | let fourth_string = captures.get(4)?.as_str().to_string(); |
| 139 | |
| 140 | Some((first_string, second_string, number, fourth_string)) |
| 141 | } else { |
| 142 | None |
| 143 | } |
| 144 | } |