Lines Matching full:regex
1 regex chapter
10 …[Build status](https://github.com/rust-lang/regex/workflows/ci/badge.svg)](https://github.com/rust…
11 [](https://crates.io/crates/regex)
12 …ps://img.shields.io/badge/rust-1.41.1%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/regex)
16 [Module documentation with examples](https://docs.rs/regex).
22 [`Regex` type](https://docs.rs/regex/*/regex/struct.Regex.html).
26 To bring this crate into your repository, either add `regex` to your
27 `Cargo.toml`, or run `cargo add regex`.
33 use regex::Regex;
36 let re = Regex::new(r"(?x)
55 use regex::Regex;
62 let re = Regex::new(r"(\d{4})-(\d{2})-(\d{2})").unwrap();
65 // Note that all of the unwraps are actually OK for this regex
66 // because the only way for the regex to match is if all of the
83 ### Usage: Avoid compiling the same regex in a loop
87 to a few **milliseconds** depending on the size of the regex.) Not only is
99 use regex::Regex;
103 static ref RE: Regex = Regex::new("...").unwrap();
109 Specifically, in this example, the regex will be compiled when it is used for
114 The main API of this crate (`regex::Regex`) requires the caller to pass a
118 To match on arbitrary bytes, use the `regex::bytes::Regex` API. The API
121 `regex::bytes::Regex`, while `.` will match any *UTF-8 encoded Unicode scalar
127 use regex::bytes::Regex;
129 let re = Regex::new(r"(?P<cstr>[^\x00]+)\x00").unwrap();
151 use regex::RegexSet;
167 // You can also test whether a particular regex matched:
185 This may be useful if you're implementing your own regex engine or otherwise
189 [Documentation `regex-syntax`.](https://docs.rs/regex-syntax)
205 [dependencies.regex]
208 # regex currently requires the standard library, you must re-enable it.
212 This will reduce the dependency tree of `regex` down to a single crate
213 (`regex-syntax`).
216 [in the "Crate features" section of the documentation](https://docs.rs/regex/*/#crate-features).
225 regex 1.0 requires Rust 1.20.0, then regex 1.0.z for all values of `z` will
226 also require Rust 1.20.0 or newer. However, regex 1.y for `y > 0` may require a
244 The data in `regex-syntax/src/unicode_tables/` is licensed under the Unicode