Skip to main content

libdd_common/
regex_engine.rs

1// Copyright 2021-Present Datadog, Inc. https://www.datadoghq.com/
2// SPDX-License-Identifier: Apache-2.0
3
4//! Workspace-wide regex engine re-exports.
5//!
6//! By default this module re-exports from the full [`regex`] crate.
7//! Enable the **`regex-lite`** feature to switch to [`regex_lite`] instead,
8//! which trades advanced features (Unicode classes, look-around, etc.) for
9//! smaller binary size and faster compile times.
10//!
11//! The **`require-regex-full`** feature forces the full `regex` crate even
12//! when `regex-lite` is enabled, for consumers that evaluate user-provided
13//! regexes requiring Unicode character class support.
14
15#[cfg(all(feature = "regex-lite", not(feature = "require-regex-full")))]
16pub use regex_lite::{escape, Captures, Regex, RegexBuilder, Replacer};
17
18#[cfg(not(all(feature = "regex-lite", not(feature = "require-regex-full"))))]
19pub use regex::{escape, Captures, Regex, RegexBuilder, Replacer};