1 // Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2 // file at the top-level directory of this distribution and at
3 // http://rust-lang.org/COPYRIGHT.
5 // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8 // option. This file may not be copied, modified, or distributed
9 // except according to those terms.
11 // ignore-lexer-test FIXME #15679
13 //! Regular expressions implemented in Rust
15 //! For official documentation, see the rust-lang/regex crate
16 #![crate_name = "regex"]
17 #![crate_type = "rlib"]
18 #![crate_type = "dylib"]
19 #![unstable = "use the crates.io `regex` library instead"]
21 #![doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
22 html_favicon_url = "http://www.rust-lang.org/favicon.ico",
23 html_root_url = "http://doc.rust-lang.org/nightly/",
24 html_playground_url = "http://play.rust-lang.org/")]
26 #![allow(unknown_features)]
28 #![feature(slicing_syntax)]
29 #![feature(box_syntax)]
30 #![allow(unknown_features)] #![feature(int_uint)]
31 #![deny(missing_docs)]
34 extern crate "test" as stdtest;
38 // During tests, this links with the `regex` crate so that the `regex!` macro
43 // Unicode tables for character classes are defined in libunicode
47 pub use re::{Regex, Captures, SubCaptures, SubCapturesPos};
48 pub use re::{FindCaptures, FindMatches};
49 pub use re::{Replacer, NoExpand, RegexSplits, RegexSplitsN};
50 pub use re::{quote, is_match};
60 /// The `native` module exists to support the `regex!` macro. Do not use.
63 // Exporting this stuff is bad form, but it's necessary for two reasons.
64 // Firstly, the `regex!` syntax extension is in a different crate and
65 // requires access to the representation of a regex (particularly the
66 // instruction set) in order to compile to native Rust. This could be
67 // mitigated if `regex!` was defined in the same crate, but this has
68 // undesirable consequences (such as requiring a dependency on
71 // Secondly, the code generated by `regex!` must *also* be able
72 // to access various functions in this crate to reduce code duplication
73 // and to provide a value with precisely the same `Regex` type in this
74 // crate. This, AFAIK, is impossible to mitigate.
76 // On the bright side, `rustdoc` lets us hide this from the public API
80 OneChar, CharClass, Any, Save, Jump, Split,
81 Match, EmptyBegin, EmptyEnd, EmptyWordBoundary,
84 FLAG_EMPTY, FLAG_NOCASE, FLAG_MULTI, FLAG_DOTNL,
85 FLAG_SWAP_GREED, FLAG_NEGATED,
87 pub use re::{Dynamic, ExDynamic, Native, ExNative};
89 MatchKind, Exists, Location, Submatches,
90 StepState, StepMatchEarlyReturn, StepMatch, StepContinue,
91 CharReader, find_prefix,