use ::regex::{Regex, RegexBuilder};
pub(crate) mod date_dash;
pub(crate) mod date_time;
pub(crate) mod duration;
pub(crate) mod email;
pub(crate) mod ip_v4;
pub(crate) mod ip_v6;
pub(crate) mod json;
pub(crate) mod jvm_stack;
pub(crate) mod key_value;
pub(crate) mod keyword;
pub(crate) mod number;
pub(crate) mod pointer;
pub(crate) mod quote;
pub(crate) mod regex;
pub(crate) mod unix_path;
pub(crate) mod unix_process;
pub(crate) mod url;
pub(crate) mod uuid;
pub(crate) fn build_regex(pattern: &str) -> Regex {
RegexBuilder::new(pattern)
.unicode(false)
.build()
.expect("hardcoded finder regex must compile")
}
#[cfg(test)]
pub(crate) fn span_texts<'a>(input: &'a str, finder: &impl super::span::Finder) -> Vec<&'a str> {
let mut collector = super::span::Collector::new();
finder.find_spans(input, &mut collector);
collector.into_spans().iter().map(|s| &input[s.start..s.end]).collect()
}