Slide 60
Slide 60 text
lazy_static! {
static ref RE: Regex = Regex::new(
r"(?xu) #US date
(?P \d{2} ) # the month
/
(?P \d{2} ) # the day
/
(?P \d{4} ) # the year
",
)
.unwrap();
}
let before = "01/30/2018, 12/12/2019";
let after = RE.replace_all(before, "$y-$m-$d");
assert_eq!(after, "2018-01-30, 2019-12-12");