Skip to content

Instantly share code, notes, and snippets.

View dengyunsheng250's full-sized avatar

邓云升 dengyunsheng250

  • northwest university
  • 09:43 (UTC -12:00)
View GitHub Profile
@dengyunsheng250
dengyunsheng250 / main.rs
Created March 18, 2024 13:07
Rust题目解答
use regex::Regex;
use std::collections::HashMap;
use std::fs;
fn main() {
let content = read();
let re = Regex::new(r#"^(?P<ip>\S+) \S+ \S+ \[(?P<timestamp>[^\]]+)\] "(?P<method>\S+) (?P<path>[^\s]+) \S+" (?P<status>\d+) \d+ "(?P<referrer>[^"]*)" "(?P<user_agent>[^"]*)"$"#).unwrap();
let mut mac = HashMap::new();
let mut linux = HashMap::new();
let mut win = HashMap::new();