accept review suggestion

Co-authored-by: Noah Lev <camelidcamel@gmail.com>
This commit is contained in:
Tshepang Mbambo 2022-08-02 05:38:20 +02:00 committed by GitHub
parent 483a0a5ab7
commit 456008cc35
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 3 deletions

View File

@ -38,10 +38,18 @@ impl fmt::Display for Date {
fn make_date_regex() -> Regex { fn make_date_regex() -> Regex {
Regex::new( Regex::new(
r"(?x) r"(?x) # insignificant whitespace mode
(?:<!--\s+date-check:\s+(\D+)\s+(\d{4})\s+-->) (<!--\s*
date-check:\s*
(?P<m1>\D+)\s+
(?P<y1>\d{4})\s*-->
)
| |
(?:<!--\s+date-check\s+-->\s+(\D+)\s+(\d{4})\b) (<!--\s*
date-check\s*-->\s+
(?P<m2>\D+)\s+
(?P<y2>\d{4})\b
)
", ",
) )
.unwrap() .unwrap()