- 
                Notifications
    
You must be signed in to change notification settings  - Fork 573
 
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Is your feature request related to a problem? Please describe.
The PatternMatch analyzer in Deequ currently lacks support for validating common US data formats, such as phone numbers and postal codes. This forces users to implement custom regex validation, leading to inconsistent implementations.
Describe the solution you'd like
Add built-in support for validating US phone numbers and postal codes using the following regex patterns:
- 
US Phone Number Regex:
val PHONE_NUMBER_US: Regex = """^(?:\+1\s?)?(?:\(?[2-9][0-9]{2}\)?[\s-]?)?[2-9][0-9]{2}[\s-]?[0-9]{4}(?:\s?(?:ext|x|extension)\s?[0-9]{4})?$""".r
 - 
US Postal Code Regex:
val POSTAL_CODE_US: Regex = """\b\d{5}(?:-\d{4})?\b""".r
 
Describe alternatives you've considered
Custom regex implementations, but these add complexity and inconsistency across projects.
Additional context
These patterns are commonly used in US data validation (e.g., customer records, shipping data). Including them in Deequ would simplify validation workflows.
Additionally, the current codebase has limited unit tests and lacks examples demonstrating the use of PatternMatch.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request