foxtive 0.25.6

Foxtive Framework
Documentation
mod tester;
mod text_cleaner;

pub use tester::*;
pub use text_cleaner::TextCleaner;

/// Enum to specify case-sensitivity and character transformation rules.
#[derive(Clone, Copy)]
pub enum CaseSensitivity {
    CaseSensitive,
    CaseInsensitive,
}

/// Enum representing different types of cleaning patterns for text sanitization.
#[derive(Clone)]
pub enum RegexType {
    /// Keeps only lowercase letters, removes everything else (max 38 chars).
    Alphabetic(CaseSensitivity),

    /// Keeps only letters and numbers, ensures it starts with a letter (max 38 chars).
    AlphaNumeric(CaseSensitivity),

    /// Keeps letters and numbers, no restriction on starting character (max 38 chars).
    AlphaNumericLoose(CaseSensitivity),

    /// Keeps letters, digits, and spaces, normalizes whitespace to single spaces.
    AlphaNumericSpace(CaseSensitivity),

    /// Keeps letters, digits, and hyphens, removes consecutive/trailing hyphens.
    AlphaNumericDash(CaseSensitivity),

    /// Keeps letters, digits, and dots, removes consecutive/trailing dots.
    AlphaNumericDot(CaseSensitivity),

    /// Keeps letters, digits, hyphens, and dots, removes consecutive/trailing special chars.
    AlphaNumericDashDot(CaseSensitivity),

    /// Keeps letters, digits, and underscores, removes consecutive/trailing underscores.
    AlphaNumericUnderscore(CaseSensitivity),

    /// Keeps letters, digits, dots, and underscores, removes consecutive/trailing special chars.
    AlphaNumericDotUnderscore(CaseSensitivity),

    /// Keeps digits, removes everything else
    Digits,

    /// Basic email validation/cleaning
    Email,

    /// Use a custom cleaning pattern (allowed_chars, max_length)
    Custom(&'static str, Option<CaseSensitivity>, usize),
}