Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 1.3 KB

README.md

File metadata and controls

32 lines (23 loc) · 1.3 KB

regex

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.

Build status Crates.io Rust

Feature Instructions

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.