Match Stage
The Match stage is the second step in the Pipe lifecycle. It is executed only if all previous Conditions have passed.
While Conditions check for structural integrity (type and size), the Match stage focuses on semantic validation - ensuring the content of the data follows a specific pattern or format.
Execution Rule
The Match stage is the bridge between "is this data the right shape?" and "is this data the right content?". It is primarily powered by Regular Expressions (Regex) and format-specific validators.
Best Practices
Combine with Conditions
Use conditions for structural validation, then match for content:
email={
"type": str,
"conditions": {Pipe.Condition.MaxLength: 64}, # Structure
"matches": {Pipe.Match.Format.Email: None} # Content
}
Use Appropriate Validators
Choose the right validator for your use case:
- Email: Use
Match.Format.Email - URL: Use
Match.Web.URL - Phone: Use
Match.Format.E164Phone - Custom patterns: Use
Match.Regex.FullMatchorMatch.Regex.Search
Regex Performance
Complex regex patterns can be slow. Test performance with realistic data:
# Simple and fast
r"^\d{5}$"
# Complex and potentially slow
r"^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[@$!%*?&])[A-Za-z\d@$!%*?&]{8,}$"
Run conditions before match to increase performance:
email={
"type": str,
"conditions": {Pipe.Condition.MaxLength: 64}, # Structure
"matches": {Pipe.Match.Format.Email: None} # Content
}
Case Sensitivity
Most match handlers are case-sensitive.
Technical Reference
The following section is automatically generated from the source code, detailing the available condition handlers and their configurations.
Match
Central registry for all match handler units.
This class provides a convenient way to access different match handlers (e.g., Text, Regex, Web) from a single location.
Source code in pipeline/handlers/match_handler/match.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | |
MatchEncoding
Registry for encoding-related match handlers.
Includes handlers for Base64, JSON, etc.
Source code in pipeline/handlers/match_handler/units/match_encoding.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
Base64
Bases: MatchHandler[str, None]
Checks if string is valid Base64 encoded
Source code in pipeline/handlers/match_handler/units/match_encoding.py
15 16 17 18 19 20 21 22 23 24 25 26 | |
JSON
Bases: MatchHandler[str, None]
Validates that a string is a correctly formatted JSON object or array
Source code in pipeline/handlers/match_handler/units/match_encoding.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
MatchFormat
Registry for format-related match handlers.
Includes handlers for Email, UUID, HexColor, etc.
Source code in pipeline/handlers/match_handler/units/match_format.py
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
E164Phone
Bases: MatchHandler[str, None]
International phone numbers in E.164 format (e.g., +1234567890)
Source code in pipeline/handlers/match_handler/units/match_format.py
53 54 55 56 57 58 59 60 61 62 63 | |
Email
Bases: MatchHandler[str, None]
Accepts email addresses with standard user, domain, and TLD parts
Source code in pipeline/handlers/match_handler/units/match_format.py
17 18 19 20 21 22 23 24 25 26 27 28 | |
HexColor
Bases: MatchHandler[str, None]
Accepts hex colors in 3 or 6 digit formats (e.g., #F00, #FF0000)
Source code in pipeline/handlers/match_handler/units/match_format.py
41 42 43 44 45 46 47 48 49 50 51 | |
Password
Bases: MatchHandler[str, str]
Validates password strength based on three policies: RELAXED, NORMAL, or STRICT.
Policies: - RELAXED: 6-64 chars, 1 uppercase, 1 lowercase. - NORMAL: 6-64 chars, 1 uppercase, 1 lowercase, 1 digit. - STRICT: 6-64 chars, 1 uppercase, 1 lowercase, 1 digit, 1 special character.
Requires a policy argument (e.g., Match.Format.Password.NORMAL)
Source code in pipeline/handlers/match_handler/units/match_format.py
65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | |
UUID
Bases: MatchHandler[str, None]
Validates 36-character hexadecimal unique identifiers (8-4-4-4-12)
Source code in pipeline/handlers/match_handler/units/match_format.py
30 31 32 33 34 35 36 37 38 39 | |
MatchLocalization
Registry for localization-related match handlers.
Includes handlers for Country, Currency, Language (ISO codes), and Timezones.
Source code in pipeline/handlers/match_handler/units/match_localization.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | |
Country
Bases: MatchHandler[str, None]
ISO 3166-1 alpha-2 (e.g., 'US', 'DE', 'JP')
Source code in pipeline/handlers/match_handler/units/match_localization.py
18 19 20 21 22 23 24 25 26 27 28 | |
Currency
Bases: MatchHandler[str, None]
ISO 4217 (e.g., 'USD', 'EUR', 'BTC')
Source code in pipeline/handlers/match_handler/units/match_localization.py
30 31 32 33 34 35 36 37 38 39 40 | |
Language
Bases: MatchHandler[str, None]
ISO 639-1 (e.g., 'en', 'fr', 'zh')
Source code in pipeline/handlers/match_handler/units/match_localization.py
42 43 44 45 46 47 48 49 50 51 52 | |
Timezone
Bases: MatchHandler[str, None]
IANA Timezone (e.g., 'America/New_York', 'Europe/London')
Source code in pipeline/handlers/match_handler/units/match_localization.py
54 55 56 57 58 59 60 61 62 63 | |
MatchNetwork
Registry for network-related match handlers.
Includes handlers for IPv4, IPv6, MAC Addresses, etc.
Source code in pipeline/handlers/match_handler/units/match_network.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | |
IPv4
Bases: MatchHandler[str, None]
Validates a standard IPv4 address (e.g., '192.168.1.1')
Source code in pipeline/handlers/match_handler/units/match_network.py
15 16 17 18 19 20 21 22 23 24 25 | |
IPv6
Bases: MatchHandler[str, None]
Validates an IPv6 address (e.g., '2001:db8::ff00:42:8329')
Source code in pipeline/handlers/match_handler/units/match_network.py
27 28 29 30 31 32 33 34 35 36 37 | |
MACAddress
Bases: MatchHandler[str, None]
Accepts hardware MAC addresses using colon, hyphen, or dot separators
Source code in pipeline/handlers/match_handler/units/match_network.py
39 40 41 42 43 44 45 46 47 48 49 50 | |
MatchRegex
Registry for regex-related match handlers.
Includes handlers for Search and FullMatch.
Source code in pipeline/handlers/match_handler/units/match_regex.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 | |
FullMatch
Bases: MatchHandler[str, str | Pattern]
Accepts values that match the provided regex pattern in their entirety
Source code in pipeline/handlers/match_handler/units/match_regex.py
28 29 30 31 32 33 34 35 36 37 38 39 | |
Search
Bases: MatchHandler[str, str | Pattern]
Accepts values that contain at least one match of the provided regex pattern
Source code in pipeline/handlers/match_handler/units/match_regex.py
15 16 17 18 19 20 21 22 23 24 25 26 | |
MatchText
Registry for text-related match handlers.
Includes handlers for Lowercase, Uppercase, Digits, etc.
Source code in pipeline/handlers/match_handler/units/match_text.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | |
Alphanumeric
Bases: MatchHandler[str, None]
Accepts letters and numeric digits. No symbols or spaces
Source code in pipeline/handlers/match_handler/units/match_text.py
57 58 59 60 61 62 63 64 65 66 | |
Digits
Bases: MatchHandler[str, None]
Accepts ONLY numeric digits (0-9)
Source code in pipeline/handlers/match_handler/units/match_text.py
46 47 48 49 50 51 52 53 54 55 | |
Letters
Bases: MatchHandler[str, None]
Accepts ONLY case English letters (a-z, A-Z)
Source code in pipeline/handlers/match_handler/units/match_text.py
35 36 37 38 39 40 41 42 43 44 | |
Lowercase
Bases: MatchHandler[str, None]
Accepts ONLY lowercase English letters (a-z)
Source code in pipeline/handlers/match_handler/units/match_text.py
13 14 15 16 17 18 19 20 21 22 | |
NoWhitespace
Bases: MatchHandler[str, None]
Ensures string contains no spaces, tabs, or line breaks
Source code in pipeline/handlers/match_handler/units/match_text.py
80 81 82 83 84 85 86 87 88 89 | |
Printable
Bases: MatchHandler[str, None]
Accepts letters, numbers, symbols, and spaces (ASCII 20-7E)
Source code in pipeline/handlers/match_handler/units/match_text.py
68 69 70 71 72 73 74 75 76 77 78 | |
Slug
Bases: MatchHandler[str, None]
URL-friendly strings: 'my-cool-post-123'
Source code in pipeline/handlers/match_handler/units/match_text.py
91 92 93 94 95 96 97 98 99 100 101 | |
Uppercase
Bases: MatchHandler[str, None]
Accepts ONLY uppercase English letters (A-Z)
Source code in pipeline/handlers/match_handler/units/match_text.py
24 25 26 27 28 29 30 31 32 33 | |
MatchTime
Registry for time-related match handlers.
Includes handlers for Date, Time, and DateTime (ISO 8601).
Source code in pipeline/handlers/match_handler/units/match_time.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 | |
Date
Bases: MatchHandler[str, None]
Validates YYYY-MM-DD format
Source code in pipeline/handlers/match_handler/units/match_time.py
13 14 15 16 17 18 19 20 21 22 23 24 | |
DateTime
Bases: MatchHandler[str, None]
Validates ISO 8601 combined Date and Time (e.g., 2023-10-01T14:30:00Z)
Source code in pipeline/handlers/match_handler/units/match_time.py
37 38 39 40 41 42 43 44 45 46 47 48 | |
Time
Bases: MatchHandler[str, None]
Validates 24h time in HH:MM or HH:MM:SS format
Source code in pipeline/handlers/match_handler/units/match_time.py
26 27 28 29 30 31 32 33 34 35 | |
MatchWeb
Registry for web-related match handlers.
Includes handlers for Domain and URL.
Source code in pipeline/handlers/match_handler/units/match_web.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | |
Domain
Bases: MatchHandler[str, None]
Validates a domain name based on RFC 1035.
Source code in pipeline/handlers/match_handler/units/match_web.py
14 15 16 17 18 19 20 21 22 23 | |
URL
Bases: MatchHandler[str, None]
Validates web URLs using HTTP or HTTPS protocols.
Source code in pipeline/handlers/match_handler/units/match_web.py
25 26 27 28 29 30 31 32 33 34 | |