Home
last modified time | relevance | path

Searched full:regex (Results 1 – 25 of 1918) sorted by relevance

12345678910>>...77

/third_party/rust/rust/src/tools/clippy/tests/ui/
Dregex.stderr1 error: trivial regex
2 --> $DIR/regex.rs:18:45
4 LL | let pipe_in_wrong_position = Regex::new("|");
7 = help: the regex is unlikely to be useful as it is
8 = note: `-D clippy::trivial-regex` implied by `-D warnings`
10 error: trivial regex
11 --> $DIR/regex.rs:19:60
16 = help: the regex is unlikely to be useful as it is
18 error: regex syntax error: invalid character class range, the start must be <= the end
19 --> $DIR/regex.rs:20:42
[all …]
Dregex.rs9 extern crate regex;
11 use regex::bytes::{Regex as BRegex, RegexBuilder as BRegexBuilder, RegexSet as BRegexSet};
12 use regex::{Regex, RegexBuilder, RegexSet};
18 let pipe_in_wrong_position = Regex::new("|"); in syntax_error()
20 let wrong_char_ranice = Regex::new("[z-a]"); in syntax_error()
21 let some_unicode = Regex::new("[é-è]"); in syntax_error()
23 let some_regex = Regex::new(OPENING_PAREN); in syntax_error()
30 let not_linted = Regex::new(closing_paren); in syntax_error()
42 // These following three cases are considering valid since regex-1.8.0 in syntax_error()
43 let raw_string_error = Regex::new(r"[...\/...]"); in syntax_error()
[all …]
/third_party/selinux/libselinux/src/
Dregex.c7 #include "regex.h"
67 pcre2_code *regex; /* compiled regular expression */ member
70 int regex_prepare_data(struct regex_data **regex, char const *pattern_string, in regex_prepare_data() argument
75 *regex = regex_data_create(); in regex_prepare_data()
76 if (!(*regex)) in regex_prepare_data()
79 (*regex)->regex = pcre2_compile( in regex_prepare_data()
82 if (!(*regex)->regex) { in regex_prepare_data()
89 regex_data_free(*regex); in regex_prepare_data()
90 *regex = NULL; in regex_prepare_data()
105 int regex_load_mmap(struct mmap_area *mmap_area, struct regex_data **regex, in regex_load_mmap() argument
[all …]
/third_party/rust/crates/regex/tests/
Dtest_default.rs3 use regex;
11 // regex and the input. Other dynamic tests explicitly set the engine to use.
14 use regex::Regex;
15 Regex::new($re)
19 macro_rules! regex { macro
27 use regex::RegexSet;
66 assert!(regex::Regex::new(r"(?-u)\xFF").is_err()); in disallow_non_utf8()
67 assert!(regex::Regex::new(r"(?-u).").is_err()); in disallow_non_utf8()
68 assert!(regex::Regex::new(r"(?-u)[\xFF]").is_err()); in disallow_non_utf8()
69 assert!(regex::Regex::new(r"(?-u)☃").is_err()); in disallow_non_utf8()
[all …]
/third_party/rust/crates/regex/
DCHANGELOG.md4 regex crate.
8 * [PERF #930](https://github.com/rust-lang/regex/pull/930):
13 * [BUG #945](https://github.com/rust-lang/regex/issues/945):
23 * [FEATURE #832](https://github.com/rust-lang/regex/issues/916):
33 * [FEATURE #832](https://github.com/rust-lang/regex/pull/832):
35 * [FEATURE #857](https://github.com/rust-lang/regex/pull/857):
37 * [FEATURE #861](https://github.com/rust-lang/regex/pull/861):
39 * [FEATURE #877](https://github.com/rust-lang/regex/issues/877):
44 * [BUG #792](https://github.com/rust-lang/regex/issues/792):
53 * [BUG #680](https://github.com/rust-lang/regex/issues/680):
[all …]
DREADME.md1 regex chapter
10 …[Build status](https://github.com/rust-lang/regex/workflows/ci/badge.svg)](https://github.com/rust…
11 [![Crates.io](https://img.shields.io/crates/v/regex.svg)](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)
[all …]
DCargo.toml2 name = "regex"
7 repository = "https://github.com/rust-lang/regex"
8 documentation = "https://docs.rs/regex"
9 homepage = "https://github.com/rust-lang/regex"
21 "bench", "regex-capi", "regex-debug", "regex-syntax",
33 # https://docs.rs/regex/*/#crate-features
35 default = ["std", "perf", "unicode", "regex-syntax/default"]
39 # The 'std' feature permits the regex crate to use the standard library. This
40 # is intended to support future use cases where the regex crate may be able
43 # will prevent regex from compiling.
[all …]
DPERFORMANCE.md5 can be found here: https://docs.rs/regex
12 regex implementations, which typically use backtracking which has worst case
28 or places where the current regex engine isn't quite optimal. This guide will
34 **Advice**: Use `lazy_static` to amortize the cost of `Regex` compilation.
48 This means that in order to realize efficient regex matching, one must
50 inside a loop, then make sure your call to `Regex::new` is *outside* that loop.
57 static MY_REGEX: Regex = Regex::new("...").unwrap();
59 Unfortunately, this would seem to imply that one must pass `Regex` objects
66 use regex::Regex;
70 static ref MY_REGEX: Regex = Regex::new("...").unwrap();
[all …]
/third_party/rust/crates/regex/examples/
Dshootout-regex-dna-single.rs10 macro_rules! regex { macro
12 ::regex::Regex::new($re).unwrap()
21 seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); in main()
25 regex!("agggtaaa|tttaccct"), in main()
26 regex!("[cgt]gggtaaa|tttaccc[acg]"), in main()
27 regex!("a[act]ggtaaa|tttacc[agt]t"), in main()
28 regex!("ag[act]gtaaa|tttac[agt]ct"), in main()
29 regex!("agg[act]taaa|ttta[agt]cct"), in main()
30 regex!("aggg[acg]aaa|ttt[cgt]ccct"), in main()
31 regex!("agggt[cgt]aa|tt[acg]accct"), in main()
[all …]
Dshootout-regex-dna.rs12 macro_rules! regex { macro
14 ::regex::Regex::new($re).unwrap()
23 seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); in main()
28 regex!("agggtaaa|tttaccct"), in main()
29 regex!("[cgt]gggtaaa|tttaccc[acg]"), in main()
30 regex!("a[act]ggtaaa|tttacc[agt]t"), in main()
31 regex!("ag[act]gtaaa|tttac[agt]ct"), in main()
32 regex!("agg[act]taaa|ttta[agt]cct"), in main()
33 regex!("aggg[acg]aaa|ttt[cgt]ccct"), in main()
34 regex!("agggt[cgt]aa|tt[acg]accct"), in main()
[all …]
Dshootout-regex-dna-bytes.rs12 macro_rules! regex { macro
14 ::regex::bytes::Regex::new($re).unwrap()
23 seq = regex!(">[^\n]*\n|\n").replace_all(&seq, &b""[..]).into_owned(); in main()
28 regex!("agggtaaa|tttaccct"), in main()
29 regex!("[cgt]gggtaaa|tttaccc[acg]"), in main()
30 regex!("a[act]ggtaaa|tttacc[agt]t"), in main()
31 regex!("ag[act]gtaaa|tttac[agt]ct"), in main()
32 regex!("agg[act]taaa|ttta[agt]cct"), in main()
33 regex!("aggg[acg]aaa|ttt[cgt]ccct"), in main()
34 regex!("agggt[cgt]aa|tt[acg]accct"), in main()
[all …]
Dshootout-regex-dna-cheat.rs8 // This technically solves the problem posed in the `regex-dna` benchmark, but
9 // it cheats by combining all of the replacements into a single regex and
17 macro_rules! regex { macro
19 ::regex::Regex::new($re).unwrap()
28 seq = regex!(">[^\n]*\n|\n").replace_all(&seq, "").into_owned(); in main()
33 regex!("agggtaaa|tttaccct"), in main()
34 regex!("[cgt]gggtaaa|tttaccc[acg]"), in main()
35 regex!("a[act]ggtaaa|tttacc[agt]t"), in main()
36 regex!("ag[act]gtaaa|tttac[agt]ct"), in main()
37 regex!("agg[act]taaa|ttta[agt]cct"), in main()
[all …]
/third_party/libabigail/src/
Dabg-suppression-priv.h17 #include "abg-regex.h"
36 mutable regex::regex_t_sptr file_name_regex_;
38 mutable regex::regex_t_sptr file_name_not_regex_;
40 mutable regex::regex_t_sptr soname_regex_;
42 mutable regex::regex_t_sptr soname_not_regex_;
76 const regex::regex_t_sptr&
80 file_name_regex_ = regex::compile(file_name_regex_str_); in get_file_name_regex()
92 const regex::regex_t_sptr&
96 file_name_not_regex_ = regex::compile(file_name_not_regex_str_); in get_file_name_not_regex()
108 const regex::regex_t_sptr&
[all …]
Dabg-regex.cc21 #include "abg-regex.h"
39 regex::regex_t_sptr
41 {return regex::regex_t_sptr(p, regex::regex_t_deleter());} in build_sptr()
49 regex::regex_t_sptr
53 namespace regex namespace
56 /// Escape regex special charaters in input string.
79 /// Generate a regex pattern equivalent to testing set membership.
81 /// A string will match the resulting pattern regex, if and only if it
86 /// @return a regex pattern
91 // This cute-looking regex does not match any string. in generate_from_strings()
[all …]
/third_party/rust/crates/bindgen/bindgen-cli/
Doptions.rs67 let (regex, abi_str) = abi_override in parse_abi_override()
75 Ok((abi, regex.to_owned())) in parse_abi_override()
81 let (regex, derives) = custom_derive in parse_custom_derive()
87 Ok((derives, regex.to_owned())) in parse_custom_derive()
105 /// Mark any enum whose name matches REGEX as a set of bitfield flags.
106 #[arg(long, value_name = "REGEX")]
108 /// Mark any enum whose name matches REGEX as a newtype.
109 #[arg(long, value_name = "REGEX")]
111 /// Mark any enum whose name matches REGEX as a global newtype.
112 #[arg(long, value_name = "REGEX")]
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-subzero/include/llvm/Support/
DRegex.h1 //===-- Regex.h - Regular Expression matcher implementation -*- C++ -*-----===//
28 class Regex {
46 Regex();
47 /// Compiles the given regular expression \p Regex.
48 Regex(StringRef Regex, unsigned Flags = NoFlags);
49 Regex(const Regex &) = delete;
50 Regex &operator=(Regex regex) {
51 std::swap(preg, regex.preg);
52 std::swap(error, regex.error);
55 Regex(Regex &&regex);
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/include/llvm/Support/
DRegex.h1 //===-- Regex.h - Regular Expression matcher implementation -*- C++ -*-----===//
27 class Regex {
45 Regex();
46 /// Compiles the given regular expression \p Regex.
48 /// \param Regex - referenced string is no longer needed after this
50 Regex(StringRef Regex, unsigned Flags = NoFlags);
51 Regex(const Regex &) = delete;
52 Regex &operator=(Regex regex) {
53 std::swap(preg, regex.preg);
54 std::swap(error, regex.error);
[all …]
/third_party/rust/crates/which-rs/src/
Dlib.rs23 #[cfg(feature = "regex")]
113 /// Only available when feature `regex` is enabled.
117 /// * `regex` - A regular expression to match binaries with
124 /// use regex::Regex;
128 /// let re = Regex::new(r"python\d$").unwrap();
138 /// use regex::Regex;
140 /// which_re(Regex::new("^cargo-.*").unwrap()).unwrap()
143 #[cfg(feature = "regex")]
144 pub fn which_re(regex: impl Borrow<Regex>) -> Result<impl Iterator<Item = path::PathBuf>> { in which_re()
145 which_re_in(regex, env::var_os("PATH")) in which_re()
[all …]
/third_party/rust/crates/regex/regex-syntax/
DREADME.md1 regex-syntax
5 …[Build status](https://github.com/rust-lang/regex/workflows/ci/badge.svg)](https://github.com/rust…
6 [![Crates.io](https://img.shields.io/crates/v/regex-syntax.svg)](https://crates.io/crates/regex-syn…
7 …ps://img.shields.io/badge/rust-1.28.0%2B-blue.svg?maxAge=3600)](https://github.com/rust-lang/regex)
12 https://docs.rs/regex-syntax
55 expressions. Therefore, while there may be bugs in the regex parser itself,
57 in the compiler or the standard library. (Since `regex-syntax` has zero
70 [in the "Crate features" section of the documentation](https://docs.rs/regex-syntax/*/#crate-featur…
83 The primary purpose of this crate is to provide the parser used by `regex`.
84 Specifically, this crate is treated as an implementation detail of the `regex`,
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-10.0/llvm/lib/Support/
DRegex.cpp1 //===-- Regex.cpp - Regular Expression matcher implementation -------------===//
13 #include "llvm/Support/Regex.h"
21 // xlocale.h, this will cause trouble, because of missing regex-related types.
26 Regex::Regex() : preg(nullptr), error(REG_BADPAT) {} in Regex() function in Regex
28 Regex::Regex(StringRef regex, unsigned Flags) { in Regex() argument
31 preg->re_endp = regex.end(); in Regex()
38 error = llvm_regcomp(preg, regex.data(), flags|REG_PEND); in Regex()
41 Regex::Regex(Regex &&regex) { in Regex() argument
42 preg = regex.preg; in Regex()
43 error = regex.error; in Regex()
[all …]
/third_party/skia/third_party/externals/tint/tools/src/match/
Dmatch.go37 // Transform pattern into a regex by replacing the uses of `?`, `*`, `**`
38 // with corresponding regex patterns.
39 // As the pattern may contain other regex sequences, the string has to be
42 // b) Escape the expression so that other sequences don't confuse the regex
44 // c) Replace the placeholder tokens with the corresponding regex tokens.
63 // Escape any remaining regex characters
65 // Insert regex matchers for the substituted tokens
66 regex := "^" + escaped + "$"
67 regex = strings.ReplaceAll(regex, starstar, ".*")
68 regex = strings.ReplaceAll(regex, star, "[^/]*")
[all …]
/third_party/skia/third_party/externals/swiftshader/third_party/llvm-subzero/lib/Support/
DRegex.cpp1 //===-- Regex.cpp - Regular Expression matcher implementation -------------===//
14 #include "llvm/Support/Regex.h"
22 Regex::Regex() : preg(nullptr), error(REG_BADPAT) {} in Regex() function in Regex
24 Regex::Regex(StringRef regex, unsigned Flags) { in Regex() argument
27 preg->re_endp = regex.end(); in Regex()
34 error = llvm_regcomp(preg, regex.data(), flags|REG_PEND); in Regex()
37 Regex::Regex(Regex &&regex) { in Regex() argument
38 preg = regex.preg; in Regex()
39 error = regex.error; in Regex()
40 regex.preg = nullptr; in Regex()
[all …]
/third_party/rust/crates/regex/bench/src/
Dbench.rs3 // It's too annoying to carefully define macros based on which regex engines
13 pub use ffi::pcre1::Regex;
15 pub use ffi::onig::Regex;
17 pub use regex::{Regex, RegexSet};
19 pub use regex::bytes::{Regex, RegexSet};
21 pub use ffi::re2::Regex;
23 pub use ffi::pcre2::Regex;
25 pub use ffi::tcl::Regex;
33 // Usage: regex!(pattern)
35 // Builds a ::Regex from a borrowed string.
[all …]
/third_party/libphonenumber/metadata/src/main/java/com/google/i18n/phonenumbers/metadata/regex/
DRegexFormatter.java17 package com.google.i18n.phonenumbers.metadata.regex;
46 public static String format(String regex, FormatOption formatOption) { in format() argument
47 return new RegexFormatter(regex, formatOption).format(); in format()
51 private final String regex; field in RegexFormatter
54 private RegexFormatter(String regex, FormatOption formatOption) { in RegexFormatter() argument
55 this.regex = CharMatcher.whitespace().removeFrom(regex); in RegexFormatter()
66 while (pos < regex.length()) { in recurse()
69 if (regex.charAt(pos) == ')') { in recurse()
73 int nextToken = tokens.indexIn(regex, pos); in recurse()
75 out.append(regex.substring(pos, regex.length())); in recurse()
[all …]
/third_party/rust/crates/regex/src/
Dlib.rs13 documentation for the [`Regex`](struct.Regex.html) type.
17 This crate is [on crates.io](https://crates.io/crates/regex) and can be
18 used by adding `regex` to your dependencies in your project's `Cargo.toml`.
22 regex = "1"
32 use regex::Regex;
33 let re = Regex::new(r"^\d{4}-\d{2}-\d{2}$").unwrap();
49 # Example: Avoid compiling the same regex in a loop
54 regex.) Not only is compilation itself expensive, but this also prevents
66 use regex::Regex;
70 static ref RE: Regex = Regex::new("...").unwrap();
[all …]

12345678910>>...77