The answer is very subtle: one feature of the macro is that the result regex!can be placed in static data , for example:
static r: Regex = regex!("t?rust");
, Regex::new() . Regex::new(), . burntsushi reddit.
, regex!:
static ,static, , lazy_static!
2017 API 1.0. regex! , .
- , Regex::new(), : DFA , . , .