2 ms·
It's easy to see the usages on github: https://github.com/search?l=Rust&p=5&q=%22regex%3A%3Anew%22&type=Code https://github.com/search?l=Rust&p=5&q=%22regex%3A
by xiphias2 4y ago
It's easy to see the usages on github:
https://github.com/search?l=Rust&p=5&q=%22regex%3A%3Anew%22&type=Code https://github.com/search?l=Rust&p=5&q=%22regex%3A%3Anew%22&...
For the importance of numeric range it was quite easy to find actually a good example:
x0rz3q/advent-of-code-2020
Regex::new(r"^19[2-8][0-9]|199[0-9]|200[0-2]$").unwrap(),
);
comparitor.insert("iyr", Regex::new(r"^(201[0-9]|2020)$").unwrap());
There are lots of number parsing.
I would enable both [[:1-12:]] and [[:01-12:]] as options without / with leading zeros.
About the variables:
This file would look much more readable with variables that are reusing other regexes:
https://github.com/spcan/common-regex/blob/3238bc8ee85e0e000ea20913f09db6477edb2922/src/common.rs https://github.com/spcan/common-regex/blob/3238bc8ee85e0e000...