A Rust library for parsing, compiling, and executing regular expressions. Its syntax is similar to Perl-style regular expressions, but lacks a few features like look around and backreferences. In exchange, all searches execute in linear time with respect to the size of the regular expression and search text. Much of the syntax and implementation is inspired by RE2.
original regex does not support unicode characters in capture group names, maybe unicode is too much, then they can not decide which to use.
this repo adds support for this feature.
this is not strictly tested, use with your own risk
with this feature you can do:
let re = regex!(r"^(?P<名字>.+)$");
let cap = re.captures(t!("abc")).unwrap();
assert_eq!(&cap[0], t!("abc"));
assert_eq!(&cap[1], t!("abc"));
assert_eq!(&cap["名字"], t!("abc"));
but without it will show not support, originally it only supports characters in capture group names.