# Basic matching
email = "user@example.com"
email =~ /@/ # => 4 (position of match)
email.match?(/@/) # => true
# Capture groups
use once_cell::sync::Lazy;
use regex::Regex;
use std::str::FromStr;
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub enum Severity {
import logging
import re
_BASE_FIELDS = set(logging.makeLogRecord({}).__dict__.keys())
_PATTERNS = [
import re
text = 'INC-102301 resolved on 2026-04-06 after payment failure for order ORD-99182.'
patterns = {
'incident_id': r'INC-[0-9]{6}',