Skip to content

aohan237/regex

 
 

Repository files navigation

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.

About

rust regex cjk capture group name support

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Rust 91.7%
  • RenderScript 5.6%
  • C 1.9%
  • Other 0.8%