| [package] |
| name = "regex" |
| version = "1.4.5" #:version |
| authors = ["The Rust Project Developers"] |
| license = "MIT OR Apache-2.0" |
| readme = "README.md" |
| repository = "https://github.com/rust-lang/regex" |
| documentation = "https://docs.rs/regex" |
| homepage = "https://github.com/rust-lang/regex" |
| description = """ |
| An implementation of regular expressions for Rust. This implementation uses |
| finite automata and guarantees linear time matching on all inputs. |
| """ |
| categories = ["text-processing"] |
| autotests = false |
| exclude = ["/scripts/*", "/.github/*"] |
| |
| [workspace] |
| members = [ |
| "bench", "regex-capi", "regex-debug", "regex-syntax", |
| ] |
| |
| [lib] |
| # There are no benchmarks in the library code itself |
| bench = false |
| # Doc tests fail when some features aren't present. The easiest way to work |
| # around this is to disable automatic doc testing, but explicitly test them |
| # with `cargo test --doc`. |
| doctest = false |
| |
| # Features are documented in the "Crate features" section of the crate docs: |
| # https://docs.rs/regex/*/#crate-features |
| [features] |
| default = ["std", "perf", "unicode", "regex-syntax/default"] |
| |
| # ECOSYSTEM FEATURES |
| |
| # The 'std' feature permits the regex crate to use the standard library. This |
| # is intended to support future use cases where the regex crate may be able |
| # to compile without std, and instead just rely on 'core' and 'alloc' (for |
| # example). Currently, this isn't supported, and removing the 'std' feature |
| # will prevent regex from compiling. |
| std = [] |
| # The 'use_std' feature is DEPRECATED. It will be removed in regex 2. Until |
| # then, it is an alias for the 'std' feature. |
| use_std = ["std"] |
| |
| |
| # PERFORMANCE FEATURES |
| |
| # Enables all performance features. |
| perf = ["perf-cache", "perf-dfa", "perf-inline", "perf-literal"] |
| # Enables fast caching. (If disabled, caching is still used, but is slower.) |
| # Currently, this feature has no effect. It used to remove the thread_local |
| # dependency and use a slower internal cache, but now the default cache has |
| # been improved and thread_local is no longer a dependency at all. |
| perf-cache = [] |
| # Enables use of a lazy DFA when possible. |
| perf-dfa = [] |
| # Enables aggressive use of inlining. |
| perf-inline = [] |
| # Enables literal optimizations. |
| perf-literal = ["aho-corasick", "memchr"] |
| |
| |
| # UNICODE DATA FEATURES |
| |
| # Enables all Unicode features. This expands if new Unicode features are added. |
| unicode = [ |
| "unicode-age", |
| "unicode-bool", |
| "unicode-case", |
| "unicode-gencat", |
| "unicode-perl", |
| "unicode-script", |
| "unicode-segment", |
| "regex-syntax/unicode", |
| ] |
| # Enables use of the `Age` property, e.g., `\p{Age:3.0}`. |
| unicode-age = ["regex-syntax/unicode-age"] |
| # Enables use of a smattering of boolean properties, e.g., `\p{Emoji}`. |
| unicode-bool = ["regex-syntax/unicode-bool"] |
| # Enables Unicode-aware case insensitive matching, e.g., `(?i)β`. |
| unicode-case = ["regex-syntax/unicode-case"] |
| # Enables Unicode general categories, e.g., `\p{Letter}` or `\pL`. |
| unicode-gencat = ["regex-syntax/unicode-gencat"] |
| # Enables Unicode-aware Perl classes corresponding to `\w`, `\s` and `\d`. |
| unicode-perl = ["regex-syntax/unicode-perl"] |
| # Enables Unicode scripts and script extensions, e.g., `\p{Greek}`. |
| unicode-script = ["regex-syntax/unicode-script"] |
| # Enables Unicode segmentation properties, e.g., `\p{gcb=Extend}`. |
| unicode-segment = ["regex-syntax/unicode-segment"] |
| |
| |
| # UNSTABLE FEATURES (requires Rust nightly) |
| |
| # A blanket feature that governs whether unstable features are enabled or not. |
| # Unstable features are disabled by default, and typically rely on unstable |
| # features in rustc itself. |
| unstable = ["pattern"] |
| |
| # Enable to use the unstable pattern traits defined in std. This is enabled |
| # by default if the unstable feature is enabled. |
| pattern = [] |
| |
| # For very fast prefix literal matching. |
| [dependencies.aho-corasick] |
| version = "0.7.6" |
| optional = true |
| |
| # For skipping along search text quickly when a leading byte is known. |
| [dependencies.memchr] |
| version = "2.2.1" |
| optional = true |
| |
| # For parsing regular expressions. |
| [dependencies.regex-syntax] |
| path = "regex-syntax" |
| version = "0.6.22" |
| default-features = false |
| |
| [dev-dependencies] |
| # For examples. |
| lazy_static = "1" |
| # For property based tests. |
| quickcheck = { version = "1.0.3", default-features = false } |
| # For generating random test data. |
| rand = { version = "0.8.3", default-features = false, features = ["getrandom", "small_rng"] } |
| # To check README's example |
| # TODO: Re-enable this once the MSRV is 1.43 or greater. |
| # See: https://github.com/rust-lang/regex/issues/684 |
| # See: https://github.com/rust-lang/regex/issues/685 |
| # doc-comment = "0.3" |
| |
| # Run the test suite on the default behavior of Regex::new. |
| # This includes a mish mash of NFAs and DFAs, which are chosen automatically |
| # based on the regex. We test both of the NFA implementations by forcing their |
| # usage with the test definitions below. (We can't test the DFA implementations |
| # in the same way since they can't be used for every regex tested.) |
| [[test]] |
| path = "tests/test_default.rs" |
| name = "default" |
| |
| # The same as the default tests, but run on bytes::Regex. |
| [[test]] |
| path = "tests/test_default_bytes.rs" |
| name = "default-bytes" |
| |
| # Run the test suite on the NFA algorithm over Unicode codepoints. |
| [[test]] |
| path = "tests/test_nfa.rs" |
| name = "nfa" |
| |
| # Run the test suite on the NFA algorithm over bytes that match UTF-8 only. |
| [[test]] |
| path = "tests/test_nfa_utf8bytes.rs" |
| name = "nfa-utf8bytes" |
| |
| # Run the test suite on the NFA algorithm over arbitrary bytes. |
| [[test]] |
| path = "tests/test_nfa_bytes.rs" |
| name = "nfa-bytes" |
| |
| # Run the test suite on the backtracking engine over Unicode codepoints. |
| [[test]] |
| path = "tests/test_backtrack.rs" |
| name = "backtrack" |
| |
| # Run the test suite on the backtracking engine over bytes that match UTF-8 |
| # only. |
| [[test]] |
| path = "tests/test_backtrack_utf8bytes.rs" |
| name = "backtrack-utf8bytes" |
| |
| # Run the test suite on the backtracking engine over arbitrary bytes. |
| [[test]] |
| path = "tests/test_backtrack_bytes.rs" |
| name = "backtrack-bytes" |
| |
| # Run all backends against each regex found on crates.io and make sure |
| # that they all do the same thing. |
| [[test]] |
| path = "tests/test_crates_regex.rs" |
| name = "crates-regex" |
| |
| [profile.release] |
| debug = true |
| |
| [profile.bench] |
| debug = true |
| |
| [profile.test] |
| debug = true |