MCPcopy Create free account
hub / github.com/bedroombuilds/python2rust / is_proper_date

Function is_proper_date

17_regex/rust/io_regex/src/main.rs:7–12  ·  view source on GitHub ↗

The recognized date format is YYYY-MM-DD.

(text: &str)

Source from the content-addressed store, hash-verified

5
6/// The recognized date format is YYYY-MM-DD.
7fn 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
14fn main() {
15 println!("Type 'quit' to exit.");

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected