The recognized date format is YYYY-MM-DD.
(text: &str)
| 5 | |
| 6 | /// The recognized date format is YYYY-MM-DD. |
| 7 | fn is_proper_date(text: &str) -> bool { |
| 8 | lazy_static! { |
| 9 | static ref RE: Regex = Regex::new(r"^(\d{4})-(\d{2})-(\d{2})$").unwrap(); |
| 10 | } |
| 11 | RE.is_match(text) |
| 12 | } |
| 13 | |
| 14 | fn main() { |
| 15 | println!("Type 'quit' to exit."); |